mirror of
https://github.com/Kynde/airc.git
synced 2026-10-20 08:31:38 +02:00
CLAUDE_BUSY keyed on the token counter in the spinner's parenthetical, but Claude Code 2.1.263 only draws that parenthetical once it has something to report. Before the first token of a turn there is no counter at all — the pane shows a bare "✽ Cooking…", then "✶ Flambéing… (5s · thinking with high effort)" — so the busy match failed, the screen fell through to the empty-"❯" check, and a thinking agent was published as FINISHED. On a high-effort turn that is minutes of a running agent showing up grey, which is exactly backwards for the one state the HUD exists to surface. The one part every build renders is the spinner word itself, so that is what is matched now: a line whose FIRST token is a word ending in "…". The old time+token parenthetical and "esc to interrupt" stay as alternatives — a narrow pane can wrap the line and split the word from its ellipsis, and the counter survives that. WHERE it matches turned out to be half the signature. Scanning the whole screen, any pane whose transcript merely quotes a spinner line reads as busy forever after its turn ends: a pasted log, or — the case that caught this — an agent working on this very file, printing "· Moseying… (6m 28s · ↓ 27.3k tokens)" into its own answer and pinning its window orange. The shipped regex had the same hole; the ellipsis rule only widened it. So CLAUDE_BUSY is now handed claudeStatusArea() — the 12 lines above the last "❯" line — and must match at column 0. Across 583 live busy captures the real spinner sat 3-9 lines above the composer, every one of them at column 0, while everything the agent said is indented under its "●" bullet and scrolls away from there. Three fixtures, all captured from throwaway panes: claude-busy-spinner (bare spinner, no parenthetical), claude-busy-effort (timer and effort clause, still no tokens), and claude-idle-quoting-spinner (finished, transcript quoting all four spinner shapes) — the last one reads busy under both the old regex and an unscoped ellipsis rule, so it pins the scoping rather than the wording. Verified beyond the fixtures by replaying 616 captures collected from live panes during a working session: 598 busy stay busy, the 8 pre-token thinking screens flip to busy, and every idle/waiting/none is unchanged. Then end to end through GET /api/attention on a restarted server, where a probe pane held busy for a full 20s thinking phase and flipped the instant the answer landed. The obvious simplification is a trap worth naming: a finished turn leaves "✻ Sautéed for 53s · done 4:03 PM" in the transcript, same glyph family as the spinner. Keying on the glyph alone would read every completed turn as running. The ellipsis is what separates them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YZC651gHvqw2C7qCVXpUu5