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 Mar 13, 2026
Conversation
…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
approved these changes
Mar 13, 2026
Collaborator
|
fixed #534 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
LocalClient hardcoded Role.ROOT, causing _get_root_uris_for_type() to
return [] and skip hierarchical traversal entirely.
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().