Push agent status changes via per-pane event subscriptions - #20
Merged
Conversation
Agent status transitions had no push channel: herdr emits pane.agent_status_changed only through per-pane parameterized subscriptions, so sync relied on the 1s pane.list poll and stalled in background tabs. - bridge: maintain a per-connection subscription that tracks panes with a detected agent, rebuilt on membership events with a fallback poll - web: accept dot-named events without data.type and refresh on visibility/focus/online
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the multi-connection support in #18.
Problem
Agent running-status transitions (working/idle/done) had no push channel. Herdr emits
pane.agent_status_changedonly through per-pane parameterized subscriptions, which the bridge never made, so status sync relied solely on the 1spane.listpoll. Browsers throttle timers in hidden tabs, so an agent could stay showing a stale status (e.g. idle after starting work) until the tab regained focus.Changes
server/src/connections/agent-status-subscription.ts) that tracks panes with a detected agent. The pane set is seeded frompane.listand rebuilt onpane_agent_detected/pane_closed/tab_closed/workspace_closedwith a debounced wake plus a fallback poll; membership changes requested mid-RPC are never lost, and transient subscribe failures retry without killing the loop.HerdrClient.subscribeaccepts parameterized subscriptions (e.g.{ type, pane_id }).typefield (previously dropped by validation).Verification
bun run format,bun run lint,bun run typecheck(web + server)bun run test: 558 pass, including 10 new subscription-loop cases (rebuild races, retry, stop) and event-validation coverage