Skip to content

fix(web): update graph nodes correctly on loop-back iterations#41

Merged
jrob5756 merged 1 commit intomainfrom
fix/graph-node-loopback-update
Mar 16, 2026
Merged

fix(web): update graph nodes correctly on loop-back iterations#41
jrob5756 merged 1 commit intomainfrom
fix/graph-node-loopback-update

Conversation

@jrob5756
Copy link
Copy Markdown
Collaborator

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_started for a new loop-back iteration). Now connect() always fetches full state before opening the WebSocket, with an AbortController to cancel in-flight fetches on cleanup/reconnect.

  • useStatusTransition handles loop-back re-entry: The animation hook previously only fired node-activate on pending → running, so completed → running (loop-back) got no visual feedback. Now it fires on any transition to running (or waiting for GateNode). The existing prev === status guard prevents spurious animations on mount.

Test plan

  • Frontend builds successfully (tsc -b && vite build)
  • All 1666 tests pass (uv run pytest tests/)
  • Lint, format, and typecheck pass (make check)
  • Manual: Run a loop-back workflow with --web, verify nodes flash blue on each revisit then green on completion
  • Manual: Open dashboard, disable network in DevTools for 2-3s mid-workflow, re-enable — verify graph recovers to correct state

🤖 Generated with Claude Code

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>
@jrob5756 jrob5756 merged commit 1f91b7a into main Mar 16, 2026
7 checks passed
@jrob5756 jrob5756 deleted the fix/graph-node-loopback-update branch March 16, 2026 21:39
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