docs: design for session state, compaction, and pluggable permissions#183
Open
rdwj wants to merge 2 commits into
Open
docs: design for session state, compaction, and pluggable permissions#183rdwj wants to merge 2 commits into
rdwj wants to merge 2 commits into
Conversation
Foundation design for #163 (Question tool), #164 (per-tool permission policy), #166 (auto-compaction), and #168 (session fork). These four issues share a single contract surface — the shape of the session row, the lifecycle of pending state (open tool calls, pending operator questions, in-flight subagent invocations), and the layering of compaction and permission resolution. Pinning the contract once in a single doc (mirroring the precedent set by planning/subagent-tool-design.md) so each downstream issue can reference it instead of re-spec'ing locally. The Phase 0 tracker issue (#182) is the implementation entry point. Notable decisions captured: - Compaction is client-side (vLLM, llama.cpp, Bedrock, Vertex generally do not support server-side compaction, so the framework owns it). - Marker-based rolling summary with a frozen prefix and pinned tail — matches the dominant production shape (Anthropic compact_2026_01_12, Claude Code, Codex CLI). - Tool-call/tool-result pairs survive compaction together; orphaned tool_use_ids are a documented LLM-failure class. - PermissionSource is pluggable: StaticPermissionSource (yaml) for vanilla RHOAI deployments, KagentiPermissionSource for Kagenti, and OGXPermissionSource for LlamaStack-shielded deployments. - BaseAgent stays unaware of compaction, sessions, and permissions — these remain server-layer ABCs alongside SessionStore and TraceStore. Assisted-by: Claude Code (Opus 4.7)
Add an Architecture Decisions bullet for the new planning/session-state-compaction-design.md so readers landing in CLAUDE.md see the contract for #163/#164/#166/#168 alongside the existing Subagent-as-tool entry it mirrors. Also tack the v2 follow-up issues (#179 streaming, #180 kagenti discovery, #181 remote depth enforcement) onto the Subagent-as-tool bullet so the deferred-work pointers live next to the v1 scope cuts that produced them. Assisted-by: Claude Code (Opus 4.7)
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.
Summary
Adds
planning/session-state-compaction-design.md— the foundation design referenced by #163, #164, #166, #168, and the Phase 0 tracker #182.These four issues share a contract surface (session row schema, pending-state lifecycle, compaction and permission layering). Without a shared design, we'd re-do the session schema two or three times as each feature discovers what it needs and ship incompatible pause/resume semantics. This doc pins the contract once. Mirrors the precedent set by
planning/subagent-tool-design.md.Notable decisions
compact_2026_01_12does, but we target multiple endpoints). Framework owns it.tool_use_idsare a documented LLM-failure class (LangChain #29637, n8n #7c1985e).PermissionSourceis pluggable.StaticPermissionSource(yaml) for vanilla RHOAI deployments,KagentiPermissionSourcefor Kagenti,OGXPermissionSourcefor LlamaStack-shielded deployments.SessionStoreandTraceStore.Phased rollout
Test plan