Skip to content

fix(claude): keep spinner + tokens visible in long TodoWrite blocks#288

Merged
kbwo merged 1 commit intomainfrom
20260419-f3c02b
Apr 19, 2026
Merged

fix(claude): keep spinner + tokens visible in long TodoWrite blocks#288
kbwo merged 1 commit intomainfrom
20260419-f3c02b

Conversation

@kbwo
Copy link
Copy Markdown
Owner

@kbwo kbwo commented Apr 19, 2026

Summary

  • Remove the BUSY_LOOKBACK_LINES = 5 slice in getRecentContentAbovePromptBox. When Claude Code's TodoWrite renders a long checklist inside the same recent block as the spinner header, the cap dropped the spinner + token stats lines and the detector fell through to idle.
  • The empty-line boundary introduced in fix: avoid stale Claude busy detection #249 already separates stale redraw fragments, so the additional cap was redundant and only caused false idle detections on long updates.

Repro (before fix)

Claude Code was rendering the following block above the prompt and ccmanager kept the session in idle instead of busy:

✽ Add GitHub Actions workflow and commit… (50s · ↓ 794 tokens)
  ⎿  ✔ Create docs/index.config.json
     ✔ Reorganize existing docs into topic directories
     ✔ Add frontmatter to existing docs
     ✔ Create docs/INDEX.md, docs/README.md, templates, workflow
     ✔ Create root AGENTS.md and README.md
     ✔ Write manifest generation Go script
     ✔ Add Makefile tasks and run first generation
     ◼ Add GitHub Actions workflow and commit

The spinner + tokens line on row 1 was pushed out of the 5-line window by 8 checklist items; none of the remaining 5 lines contained a recognizable busy indicator.

Test plan

  • npm run test -- src/services/stateDetector/claude.test.ts (68 passed, including the two stale-guard tests from fix: avoid stale Claude busy detection #249 and the new TodoWrite regression test)
  • npm run lint
  • npm run typecheck
  • Full npm run test

The 5-line cap in getRecentContentAbovePromptBox dropped the spinner
header and token stats line when Claude Code's TodoWrite rendered a
long checklist inside the same recent block. The empty-line boundary
introduced in #249 already separates stale redraw fragments, so the
additional cap is redundant and caused false idle detection.
@kbwo kbwo force-pushed the 20260419-f3c02b branch from 9efec96 to 80a9271 Compare April 19, 2026 09:52
@kbwo kbwo marked this pull request as ready for review April 19, 2026 09:55
@kbwo kbwo merged commit 8823289 into main Apr 19, 2026
1 check passed
@kbwo kbwo deleted the 20260419-f3c02b branch April 19, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant