Repository navigation
Closed
Labels
ready-for-agentReady for AFK agent executionReady for AFK agent execution
Description
Parent
Parent PRD: #82
What to build
Implement the /compact slash command. This is a two-phase operation:
- Provider compaction: The server calls the provider adapter's compaction method (e.g., Codex thread/compact/start) to ask the provider to summarize the full conversation history into a compact summary text.
- Trim + summary: Once the summary is returned, the server records it via thread.context.summarize, then trims all messages before the current point via the existing thread.context.trim flow (from Slice 1), attaching the summary to the trim point.
The UI shows a ContextSummaryBanner above the trim point divider displaying the compaction summary. The summary text is also used to bootstrap the restarted provider session.
Acceptance criteria
- ProviderAdapter interface gains a compactThread method (returns summary text)
- CodexSessionRuntime implements compactThread via Codex JSON-RPC (or falls back gracefully if unsupported)
- thread.context.summarize command schema defined in contracts
- thread.context-summarized domain event schema defined in contracts
- ContextTrimPoint read model type gains optional summary field
- Server-side: for /compact, call compactThread first, then dispatch thread.context.summarize, then dispatch thread.context.trim with summary attached
- Session bootstrap after /compact: summary text is sent as initial context to the new provider session
- /compact parses correctly in the composer slash command system
- ContextSummaryBanner component renders above trim divider: shows header and summary, visually distinct
- If provider compaction fails or is unsupported, summarize is skipped but trim still proceeds
- Compaction duration is recorded on the summary event
- Tests cover: compaction flow end-to-end, summary banner rendering, fallback when compaction unsupported
Blocked by
- /clear + /clear N — core context trim infrastructure #83 (core /clear infrastructure)
Metadata
Metadata
Assignees
Labels
ready-for-agentReady for AFK agent executionReady for AFK agent execution
Activity
feat: active turn guardrails — block trim commands during generation (#…
feat: /compact — provider compaction + summary banner (#87) (#105)
harrryyd commentedon Jun 8, 2026
Merged in #105.
feat: /compact — provider compaction + summary banner (#107)
[codex] sync v0.0.27 retained features (#131)