pingdotgg / pingdotgg/t3code

[Bug]: Claude auto-compaction still shows "Thinking" — status:"compacting" is flattened into the generic running state

Open
#10,959 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted bug via-triage
Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

Before submitting
  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.
Area

apps/server

Steps to reproduce
  1. Start a thread with the Claude provider and keep working until the context fills up enough that Claude Code compacts on its own (do not type /compact).
  2. Watch the thread status in the web client while that compaction runs.
Expected behavior

Automatic compaction surfaces the same Compacting… state that #9293 added for the manual command, so it is obvious the agent is compacting rather than stalled.

Actual behavior

The thread just says Thinking (and Working for N) for the entire compaction, which can run for minutes with no output. It is indistinguishable from a stuck or looping turn.

The Compacting… state added by #9293 is gated entirely on an explicit /compact user message:

  • apps/web/src/components/ChatView.tsx:661isCompactCommandMessage matches a user message whose text is exactly /compact with no attachments
  • apps/web/src/components/ChatView.tsx:2945isCompacting is derived from that message plus turn timestamps

Automatic compaction produces no such message, and Claude's own start signal is discarded before any client can see it:

  • apps/server/src/provider/Layers/ClaudeAdapter.ts:3411SDKStatusMessage status:"compacting" is flattened into the generic waiting session state
  • apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts:261-279orchestrationSessionStatusFromRuntimeState collapses waiting into running

So by the time the orchestration session reaches the client, "compacting" and "running a normal turn" are the same value. compact_boundary only arrives after compaction, so the completed divider and token counts do render — but nothing marks the interval while it is running.

This is the case #7652 originally described (it names ClaudeAdapter's status:"compacting"waiting flattening as the root cause). #7652 was closed as fixed by #9293, and #7714 — which did implement the automatic path via an optional statusDetail: "compacting" / compactingSince on OrchestrationSession, fed by Claude's status:"compacting", Codex's contextCompaction item, and OpenCode's session.time.compacting — was closed as superseded at the same time. #9293 only shipped the manual /compact command path, so the automatic case is still unhandled on main.

Impact

Minor bug or occasional failure

(Cosmetic in mechanism, but it reliably reads as a hung agent: users cancel turns and waste tokens because a multi-minute silent Thinking looks broken.)

Version or commit

main @ 6c58362 (line numbers above verified against that commit; originally observed on a fork tracking upstream 299404a)

Environment

Linux, web client served from source (apps/server + apps/web), Node 24.15, Claude provider.

Logs or stack traces
n/a — no error is produced; the status label is simply generic.
Workaround

None for automatic compaction. Typing /compact manually does show Compacting…, but that only covers the case that already works.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/server/src/provider/Layers/ClaudeAdapter.ts around the SDKStatusMessage handling, then trace orchestrationSessionStatusFromRuntimeState in apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts and the status derivation in apps/web/src/components/ChatView.tsx. Compare the automatic status:"compacting" path with the existing /compact path; done means automatic Claude compaction displays Compacting… instead of Thinking while it runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
full-stack
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.