Repository navigation
plat 553
github-actions[bot] edited this page Oct 6, 2026
·
3 revisions
| Field | Value |
|---|---|
| State | fixed on main |
| Priority | P2 |
| Product | chat |
| Area | reliability |
| Summary | fixed on main, not deployed: Codex, Claude, Pi, Muse and Agy compaction records become a context_compaction event and one chat row ("Compacting context…" → "Compacted context (1m 39s) · 384k → 92k tokens"); Cursor rec… |
| Coordination | Value |
|---|---|
| State | fixed on main (2026-10-06); not deployed |
| Date | 2026-10-06 |
| Owner | chat-reliability |
Owner request: show context compaction for every coding CLI in the chat, from structured records only ("show, don't scrape", PLAT-354 list). Before this, nothing in llmtypes, mcpagent or agent_go carried compaction; a long turn just went quiet for minutes.
- Provider (
multi-llm-provider-go6ea681c): new chunkcontext_compactionwith aContextCompactionpayload (phase start/end, id, trigger, outcome, tokens before/after, started/ended, duration). Per CLI:- Codex: rollout
item_completedContextCompaction = end with started/completed ms. Tokens before = the lasttoken_countinput; tokens after = the zero-inputtoken_countCodex writes right after compacting (seen on real 0.160 rollouts: 235118 → 20754). Tmux tailer and a new rollout side channel for the structured transport (codex exec --jsonhas no compaction item). - Claude: stream-json
system/status"compacting" (start),compact_boundary.compact_metadataandstatus null + compact_result(end); transcriptcompact_boundary.compactMetadata(end, tmux). Shapes from the 2.1.289 bundle and a real 2.1.226 transcript. - Pi:
--mode jsoncompaction_start/compaction_end; tmux marker extension hookssession_before_compact/session_compact/session_compact_failed(writes reason, tokensBefore, aborted only). - Muse:
context_compaction_candidaterunning (start),context_compaction_installed(end, budget before/after = Muse's estimated prompt tokens, summarizer duration).tool_results_clearedis a light prune and is not shown. - Agy: finished CHECKPOINT steps (type 23) that are not
intent_only(end, start/end from step metadata). Every real conversation has one intent-only checkpoint that only titles the chat; those are skipped.
- Codex: rollout
- mcpagent (5a9ec3e):
ContextCompactionEvent(context_compaction), emitted even when generation streaming events are suppressed. - agent_go: event in schema-gen, the durable chat allowlist and STRUCTURAL_EVENTS (survives reload). Frontend: one quiet row per compaction at the start's position: "Compacting context…" (spinner), then "Compacted context (1m 39s) · 384k → 92k tokens"; unknown parts omitted; a start left open by a finished turn reads "no result recorded".
- Tests: one fixture test per CLI parser from real record shapes (Codex, Claude transcript, Muse, Agy from real files; Pi from Pi's docs/types, no real Pi event stream on this laptop), and a vitest for the row collapse.
- Consumers pair start/end by
compaction_idand keep the newest end, so Claude can emit an end oncompact_resultand again on the later boundary (order undocumented) without two rows. - Codex and Agy have no start record, so they show only the finished row.
- The compact chat view (older turns as messages only) drops compaction rows of older turns; the latest turn and the full view keep them.
- Cursor: no structured compaction in stream-json or transcripts, only a
preCompacthook (start only, no end). Not shown. - Retained live-input follow-up turns read progress as messages, not chunks, so a compaction there is not shown (Codex, Claude, Muse, Agy).
- Not seen live: no compaction was triggered during this work (needs a very large context). Parsers are verified on recorded records; the event plumbing is shared with live usage (PLAT-554), which was checked live.
PLAT-553, P2, fixed on main, not deployed: Codex, Claude, Pi, Muse and Agy compaction records become a context_compaction event and one chat row ("Compacting context…" → "Compacted context (1m 39s) · 384k → 92k tokens"); Cursor records none.
2026-10-06: in the owner's local app a long Plan Drift chat showed "Compacted context (2m 10s) · 236k → 24k tokens".
Auto-synced from docs/ on main. Edit there, not here.