Repository navigation
[Feature]: Show compaction state and result instead of a generic "Working" #7652
Description
What
When a provider compacts a thread, the timeline shows Working for N, exactly like any other work. Nothing says compaction is running, how long it has been running, or whether it succeeded. On a long compaction the only honest read of the UI is "something is happening".
Proposal
Give compaction its own timeline state, and a result line when it lands:
Deliberately no percentage or progress bar. No provider emits real compaction progress — the Claude Code CLI's own compaction bar is a pure function of elapsed time (1 − e^(−elapsed/90s), capped at 95%; it snaps to done when the operation finishes). Replicating a synthetic bar is possible but it would be a lying spinner, so this proposal sticks to what is true: the state, the elapsed time, and the result.
What each provider gives us
| Provider | "Compacting" start signal | Completion signal | Result metadata |
|---|---|---|---|
| Claude | SDKStatusMessage status:"compacting" |
compact_boundary + end status with compact_result/compact_error |
pre_tokens, post_tokens, duration_ms, trigger |
| Codex | contextCompaction item started |
same item completed (also thread/compacted, which the protocol marks deprecated in favor of the item) |
none on the item; token usage arrives separately |
| OpenCode | session time.compacting timestamp (via session updates) |
session.compacted event |
auto flag on the CompactionPart |
| Cursor | — | — | ACP has no compaction concept |
| Grok | — | — | ACP has no compaction concept |
So three of five providers can feed a shared "compacting" thread state, and per AGENTS.md the ACP pair get an explicit "not supported here".
Where the code stands
- Claude:
ClaudeAdapter.ts:3119readsstatus:"compacting"but flattens it into the genericwaitingsession state — that is why the UI saysWorking. Thecompact_boundaryalready becomes acontext-compactionactivity (ProviderRuntimeIngestion.ts:744, summary "Context compacted") with the rawcompact_metadatain its payload, so the result line is mostly a client-rendering task.compact_result/compact_errorappear nowhere in the repo — a failed compaction is indistinguishable from a successful one. - Codex:
CodexAdapter.tsmaps compaction items to the canonicalcontext_compactiontype, but ingestion filters item lifecycle events to tool types (ProviderRuntimeIngestion.ts:847), so both the start and completion of a Codex compaction are dropped. Codex compaction visibility currently rests entirely on the deprecatedthread/compactednotification; wiring the item fixes that. - OpenCode:
OpenCodeAdapter.tshandles none of the compaction signals. - Nothing in
apps/webreferences context compaction at all — everycompacthit in the web client is layout density.
Suggested shape
- A
compactingstate on the shared thread/session contract that any adapter can raise and clear, rendered as the "Compacting context" row with a client-side elapsed timer. - The completion row rendered from the existing
context-compactionactivity, with token delta and duration where the provider supplies them (Claude), plain "Context compacted" where it does not. - A failure variant fed by Claude's
compact_result:"failed"/compact_error.
Stacked per-adapter PRs on top of the contract change would fit how this decomposes.
Related
#7589 — a heartbeat with no turn stranded a thread on Working forever after /compact. The fix stops the stranding, but compaction that outlives its turn surfaces nothing at all, which makes this gap more visible rather than less.
Screenshots are the real timeline row with the proposed states patched in.

Activity
thomasbrugman commentedon Aug 20, 2026
That seems good. I reckon we add this for other adapters that support this. So, stacked PR's may be useful here.
[-][Feature]: Show compaction progress and result instead of a generic "Working"[/-][+][Feature]: Show compaction state and result instead of a generic "Working"[/+]robertnisipeanu commentedon Aug 20, 2026
Edited the PR description and the PoC generated image. Initially it contained information only about Claude Code and it also suggested adding a compaction progress (percentage bar and percentage numbers) with it, just like it is in the CLI.
After some digging, it seems that:
thomasbrugman commentedon Aug 20, 2026
I essentially ran into the same conclusion, but thanks for confirming. I'll see what I can do.
Torrey-Smith-165 commentedon Aug 27, 2026
Would really appreciate this one getting fixed. My claude sessions keep showing "thinking" state for ~3 minutes when they are really compacting. It feels like the agent is broken and stuck in a thinking loop, especially given that T3 code has no way of allowing for displaying thinking traces.
minipuft commentedon Aug 28, 2026
+1 I end up wasting tokens canceling expecting something is going wrong. Any sort of message or notification would be better than the regular "Thinking"
6 remaining items