Skip to content

Feature/configurable session root#153

Merged
stippi merged 11 commits into
mainfrom
feature/configurable-session-root
Jul 5, 2026
Merged

Feature/configurable session root#153
stippi merged 11 commits into
mainfrom
feature/configurable-session-root

Conversation

@stippi

@stippi stippi commented Jul 4, 2026

Copy link
Copy Markdown
Owner

No description provided.

stippi added 4 commits July 4, 2026 01:33
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.
Comment thread crates/code_assistant_core/src/agent/runner.rs Outdated
stippi added 7 commits July 4, 2026 18:07
…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.
@stippi stippi merged commit dc963ae into main Jul 5, 2026
5 checks passed
@stippi stippi deleted the feature/configurable-session-root branch July 5, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant