fix(web): update graph nodes correctly on loop-back iterations#41
Merged
fix(web): update graph nodes correctly on loop-back iterations#41
Conversation
Two fixes for the web dashboard graph not reflecting re-running agents: 1. WebSocket reconnect now re-fetches /api/state — previously only the initial connection replayed state, so reconnects could permanently lose events emitted during the disconnect window. Now connect() always fetches full state before opening the WebSocket, with an AbortController to cancel in-flight fetches on cleanup/reconnect. 2. useStatusTransition fires node-activate on any transition to running, not just pending→running. This ensures loop-back re-entry (completed→running) gets the blue flash animation. The existing prev===status guard prevents spurious animations on mount. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
WebSocket reconnect re-fetches state: Previously only the initial connection replayed
/api/state, so reconnects after network drops permanently lost events emitted during the disconnect window (e.g.,agent_startedfor a new loop-back iteration). Nowconnect()always fetches full state before opening the WebSocket, with anAbortControllerto cancel in-flight fetches on cleanup/reconnect.useStatusTransitionhandles loop-back re-entry: The animation hook previously only firednode-activateonpending → running, socompleted → running(loop-back) got no visual feedback. Now it fires on any transition torunning(orwaitingforGateNode). The existingprev === statusguard prevents spurious animations on mount.Test plan
tsc -b && vite build)uv run pytest tests/)make check)--web, verify nodes flash blue on each revisit then green on completion🤖 Generated with Claude Code