Feature/configurable session root#153
Merged
Merged
Conversation
Lets embedders root the session store outside the code-assistant data directory. No behavior change for existing callers.
SessionManager::set_hooks_factory installs a factory applied to every agent (and sub-agent) it starts; None keeps code-assistant's default hooks. Lets embedders like pal swap e.g. the SystemPromptProvider while reusing the runtime.
New seam in HookRegistry: observers are notified from append_message_with_node_id, the single choke point every message (user input, assistant responses, tool results) passes through. Observers cannot veto or modify; intended for side channels such as transcript mirroring, external memory sync or metrics. First consumer: pal's transcript mirror.
The xml/caret tool-doc formatters emit parameters in schema insertion order, and 11 tests assert that order. Workspace builds got preserve_order transitively through gpui (feature unification), so the tests were green there but red when scoped (cargo test -p code_assistant_core) — and any external consumer of code_assistant_core (pal) silently built with different serialization behavior than code-assistant itself. Declare the load-bearing feature where it is relied upon.
stippi
commented
Jul 4, 2026
…essions add_user_message persists the user turn directly and the agent later loads it via restore_conversation (which does not re-notify). So a MessageObserver saw assistant output but never the user's own message when sent to an idle session. Notify observers from add_user_message. Keeps transcript mirrors and external memory sync complete on both paths.
ToolScope gains a Custom(&'static str) variant so embedding applications can define their own tool subsets without this enum knowing them. SessionManager::start_agent_for_session (and the service layer via the new SessionService::send_user_message_scoped) accept an optional per-run scope override, applied after session-state load and enforced both in the offered tool list and at dispatch. Nothing is persisted; the next run derives its scope from the session config as before. First consumer: pal's expiry watcher, whose final "save memories" turn runs restricted to the memory tools.
PromptCtx gains session_id (the agent already tracks it; MessageObserver set the precedent), so a SystemPromptProvider can key prompt content to a session — e.g. serve a snapshot that stays stable for the session's lifetime. First consumer: pal's per-incarnation frozen peer card.
LoopCtx gains session_id (same role PromptCtx::session_id plays for system-prompt providers): hook state built once per process can now be keyed per session. First consumer is pal's reset-notice hook, whose shared notice state becomes a per-session map once the embedder serves several channel lanes from one process.
Constraints for consuming MCP servers as a ToolRegistry source: per-server allowlist + scope grouping (additive scope selection is the missing upstream piece), and a read-only/outward permission policy via a ToolInterceptor before the first outward-facing integration. MCP stays a registry source, never an architecture.
…m/stippi/code-assistant into feature/configurable-session-root
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.
No description provided.