You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(canvas): address code review findings for run panel
- Replace recursive reconnection with iterative loop + .catch() safety net
- Fix _handleStreamError type signature (void | Promise<void>)
- Add stale-state guards (terminalReceived/reconnecting) after each await
- Truncate node output display at 2000 chars to prevent DOM bloat
- Reset RunInputDialog state on reopen
- Clear ResumeForm input after submit
- Update gw-frontend skill with Phase 2 patterns and accurate RunSlice shape
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
// uiSlice.ts — UI preferences only, no credentials
@@ -150,6 +155,16 @@ POST /resume POST /resume
150
155
POST /resume call returns. The server has a 2-second timeout — if no SSE
151
156
arrives, execution continues anyway (events stored in run history).
152
157
158
+
## Phase 2 patterns
159
+
160
+
Patterns from Canvas Phase 2 — follow these in subsequent phases:
161
+
162
+
-**`NodeMapEntry`** — `RunPanel` builds a `Map<string, { label, type, config }>` from graph nodes and passes it to `RunEventItem` for UUID→label resolution
163
+
-**Iterative reconnection** — `_handleStreamError` uses a for-loop (not recursion) with exponential backoff, wrapped in `.catch()` to guarantee landing in a terminal state
164
+
-**`terminalReceived` guard** — module-level flag set before disconnecting on terminal events, prevents `onerror` → reconnection race after `graph_completed`
165
+
-**Output truncation** — `RunEventItem` caps output display at 2000 chars to prevent DOM bloat from large LLM responses
166
+
-**Dialog state reset** — `RunInputDialog` resets form state via `useEffect` when `open` transitions to `true`
167
+
153
168
## Settings panel — read-only, no key input
154
169
155
170
The settings panel shows provider status only. It never has key input fields.
0 commit comments