[Feature]: Show compaction state and result instead of a generic "Working" #7652
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.
robertnisipeanu(GitHub profile, opens in a new tab) changed the title
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:
- The progress of compaction is not available in the CLI.
- The progress in claude code CLI is synthetic, and just a math formula based on how much time elapsed since starting compaction. I decided that is unreliable to use, as T3 Code would essentially have to duplicate the same formula, which could change at any time in Claude Code.
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:
- The progress of compaction is not available in the CLI.
- The progress in claude code CLI is synthetic, and just a math formula based on how much time elapsed since starting compaction. I decided that is unreliable to use, as T3 Code would essentially have to duplicate the same formula, which could change at any time in Claude Code.
I essentially ran into the same conclusion, but thanks for confirming. I'll see what I can do.
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.
+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"
+1 I have ran into this a couple of times. The agent just becomes unresponsive and I have no idea why. It is incredibly frustrating.
Closing as fixed by https://github.com/pingdotgg/t3code/pull/9293 — compaction now has its own Compacting… state and completed divider (with token counts when available) instead of a generic Working label.
juliusmarminge closed this
Sign in to join this conversation.
That seems good. I reckon we add this for other adapters that support this. So, stacked PR's may be useful here.