Skip to content

fix(status): a finish in the pane herdr has in front reads DONE, not READY - #64

Merged
devswha merged 2 commits into
mainfrom
fix/done-in-focused-pane
Sep 26, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/done-in-focused-pane

Conversation

@devswha

@devswha devswha commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Problem

Some sessions showed READY after their agent finished, instead of DONE, and sent no push alert.

herdr reports a finish as done only in panes it does not have focused; in its focused pane it reports idle. CompletionTracker treated that static focus as "someone saw it". But the web UI never moves herdr's focus, so the pane the herdr terminal last had in front stays focused while the user works from a browser or phone. Every finish in that pane read READY and pushed nothing.

Seen live: herdr focus sat on w1C7:p1 (claude, idle) while the user drove another pane from the web.

Fix

  • server/completion.ts: an idle after work reads done whatever the focus flag says. It clears when the pane works again, or when focus moves onto it (seen). observe no longer asks herdr for focus at finish time, so it is synchronous and the stale-result sequencing is gone.
  • server/collector.ts: subscribes to pane.focused on its own connection, so an older herdr refusing it cannot cost pane-exit events. Live-checked on herdr 0.9.0 (test session): a workspace or tab switch sends pane_focused for its pane too.
  • server/index.ts: on focus of a finished pane, broadcasts idle and feeds push.

Tradeoff

Someone watching the herdr terminal with that pane already in front now sees DONE in the web UI, and gets an alert when its agent finishes. It stays DONE until focus leaves and comes back, or the agent works again.

Not covered

  • The tracker is in memory, so a server restart (e.g. an auto-update) still turns tracker-made DONE (omo/gjc panes) into READY. herdr's own done survives restarts. Separate change.
  • Remote PCs get this fix only with a new remote bundle (server/ ships in it).

Tests

  • bun run typecheck passes; bun test 397/397.
  • New tests: repro (focused pane working → idle → done, a focused snapshot keeps it done, seen clears it), and parseFocusFrame against the live frame.
  • End to end against the isolated test herdr: pane.focus → collector onFocus fires with that pane.

🤖 Generated with Claude Code

…READY

herdr reports an agent that finishes in its focused pane as idle, and the
completion tracker took that static focus as "seen". The web UI never moves
herdr's focus, so the pane the terminal last had in front stayed focused
while the user worked from a browser or phone: every finish there read READY
and sent no alert.

A finish now reads done until the pane works again or a pane.focused event
brings it to the front (a separate subscription, so an older herdr refusing
it cannot cost pane exits). With focus no longer asked at finish time, the
tracker is synchronous.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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