Phantom background-task chips persist after /compact; stop and session-restart both no-op

Resolved 💬 3 comments Opened May 21, 2026 by sremani Closed Jun 20, 2026

Environment: Claude Code via ccd-cli 2.1.142, remote server, Linux, Opus 4.7 (1M context)

What happens

  • Several long-running background tasks (bash run_in_background) were spawned, then their underlying processes died / were killed out-of-band.
  • After a /compact, the CLI's in-memory task registry is wiped, but the UI still shows ~9 tasks as running.
  • Clicking Stop in the UI sends a stop_task control request → the server returns hasError=false → but the chip never clears. The CLI has no matching task record, so the stop is a silent no-op that reports success.
  • The CLI's own TaskStop / TaskOutput return "No task found" for those same IDs.
  • The chips are reconstructed on resume from the session transcript (<session>.jsonl), which logs each task start but has no terminal event for these tasks — so a CLI restart re-reads the transcript and the chips reappear.

Verification

  • Zero backing processes alive (no java/lein/child processes for the tasks).
  • No open output file descriptors for the task .output files.
  • No separate on-disk task database — the only persisted references are inside the conversation transcript JSONL.
  • Conclusion: purely a stale-state / transcript-replay artifact with no user-reachable reconcile path.

Server log evidence

stop_task task_id "b2c..."  -> RPC response: hasError=false
stop_task task_id "bm4..."  -> hasError=false
stop_task task_id "b07m..." -> hasError=false
... (repeats for all 9, every one hasError=false, chip stays "running")

Expected behavior

  1. stop_task for an unknown/already-dead task should reconcile the chip (mark it stopped/errored) rather than no-op while reporting success.
  2. /compact should either preserve the task registry or write terminal events for any in-flight tasks it abandons.
  3. Transcript replay on resume should reconcile task chips against actual process liveness instead of resurrecting started-but-unterminated tasks indefinitely.

Impact

Cosmetic but persistent: orphaned "running" chips that cannot be cleared by Stop, by CLI restart, or by session resume — the only escape is abandoning the session entirely.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗