Skip to content

Fix: change Role.ROOT to Role.USER, and mirror the HTTP server behavior (sessions.py:94-95) by calling initialize_user_directories() and initialize_agent_directories() at the start of create_session().#572

Merged
qin-ctx merged 1 commit intovolcengine:mainfrom
yangxinxin-7:fix/embedded-agent-memories
Mar 13, 2026

Conversation

@yangxinxin-7
Copy link
Copy Markdown
Collaborator

fix(embedded): LocalClient Role.ROOT and missing agent directory initialization

In embedded mode (LocalClient), two bugs prevented find() from returning
agent memories (cases/patterns) without an explicit target_uri:

  1. LocalClient hardcoded Role.ROOT, causing _get_root_uris_for_type() to
    return [] and skip hierarchical traversal entirely.

  2. create_session() never called initialize_agent_directories(), so the
    agent memory directory tree (memories/, cases/, patterns/) was never
    initialized with .abstract.md files or vector index entries. Since
    initialization must happen before the first commit, retroactive calls
    had no effect.

Fix: change Role.ROOT to Role.USER, and mirror the HTTP server behavior
(sessions.py:94-95) by calling initialize_user_directories() and
initialize_agent_directories() at the start of create_session().

…ialization

In embedded mode (LocalClient), two bugs prevented find() from returning
agent memories (cases/patterns) without an explicit target_uri:

1. LocalClient hardcoded Role.ROOT, causing _get_root_uris_for_type() to
   return [] and skip hierarchical traversal entirely.

2. create_session() never called initialize_agent_directories(), so the
   agent memory directory tree (memories/, cases/, patterns/) was never
   initialized with .abstract.md files or vector index entries. Since
   initialization must happen before the first commit, retroactive calls
   had no effect.

Fix: change Role.ROOT to Role.USER, and mirror the HTTP server behavior
(sessions.py:94-95) by calling initialize_user_directories() and
initialize_agent_directories() at the start of create_session().
@qin-ctx qin-ctx merged commit 7ea2f7f into volcengine:main Mar 13, 2026
4 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 13, 2026
@qin-ctx
Copy link
Copy Markdown
Collaborator

qin-ctx commented Mar 13, 2026

fixed #534

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants