Repository navigation
feat(studio): T02 node status overlay - #998
Merged
Merged
Conversation
Drive the canvas node status overlay from the server's `node` frames (D14/S20) instead of the gen_ai span-name heuristic: a new pure nodeStateReducer keeps the latest frame per node id (latest `at` wins, same span id overrides), useAgentStream folds `node` messages into AppState.nodeStates and resets them on agent switch, runAgent() and a new run's first `running` status (isNewRun). nodeRunStatuses maps running/waiting/done/error frames onto the card vocabulary - running is live only while the run is, waiting reads paused, and sub-path child frames raise their `sub:<name>` group node by rank. Cards gain paused/error/done state classes with warning/danger ring styling in agents.css (ring animation off under prefers-reduced-motion).
Approval waits never reached the canvas: the wait span was not stamped with the SDK node-id attribute, so nodeStates.ts derived no 'waiting' frame and the node never read paused. Compile spec agents through a new shared compileSpecWithNodeIds helper (spec/v2) that wires the nodeIdExporter into the compiler trace exporter, and teach nodeStateFor to map the approval-wait marker span start to 'waiting'. Client nodeRunStatuses maps waiting frames to paused and keeps them paused for the rest of the run.
…pe graph
The lousho/spec entry is browser-safe; typing the parameter as Subagents
made api-extractor inline the whole agent runtime type graph
(SimpleAgent, AgentRun, approvals, checkpoints...) as forgotten exports
in api/spec.api.md. A structural parameter (a name->agent record or a
{ list } catalog) accepts the same callers without the report churn.
Regenerate api/index.api.md and api/spec.api.md for the new public
exports compileSpecWithNodeIds and subAgentNodeIndexes.
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
Forge Builder ticket T02 (P6 Test and debug; deps D14 + C02, both merged). The canvas node status overlay is now driven by the server's
nodestream frames ({type:'node'},NodeStatePayload— §3.3 node ids stamped by the SDK's nodeIdExporter) instead of thegen_ai.operation.namespan-name heuristic, so every stamped node kind (agent, tools, subagents, handoffs, guardrails, approval waits, flow steps) lights up — not only LLM/tool nodes.src/state/nodeStateReducer.ts(new, pure):NodeStates= latest frame per node id;applyNodeStatekeeps the newest byat, same-span-id frames always override, returns the same object when stale (React bail-out);isNewRun(prev, next)detects a run's firstrunningstatus.useAgentStream.ts/AppState.tsx: foldsnodemessages intonodeStates, exposed onAppState; resets on agent switch, onrunAgent()(viauseAgentControls), and onisNewRun(tracked with arunStatusRef, also fed by the initial/statusfetch).canvas/nodeStatus.ts: span heuristic deleted; newnodeRunStatuses(nodeIds, nodeStates, runStatus)mapsrunning→running/paused/idle by live run status,waiting→paused,done→done,error→error; sub-path child frames (sub:<name>/…) raise their group node via the existing rank; unknown ids ignored.nodeLookup.tskept for Logs/Trace panels.NodeCard.tsx/agents.css:cardClassNamegainspaused/error/doneflags;.rf-node.pausedwarning-border pulsing ring,.rf-node.errorstatic danger-border ring,.rf-node.donepill only; ring animation off underprefers-reduced-motion. U01--warning-border/--danger-bordertokens verified present in theme.css.T01's test-pane drawer is in flight on
fb-t01-test-paneand was not a dependency; the overlay lives entirely on the canvas per the ticket.Test plan
npm run typecheck --workspace apps/agent-forge— cleannpm test --workspace apps/agent-forge -- --run— 181 files / 3480 tests passstate/__tests__/nodeStateReducer.test.ts(at-ordering, same-span override, isNewRun table),canvas/__tests__/nodeStatus.test.ts(frame mapping table, frame-by-frame run, group raise, rank, unknown ids),AgentNode.test.tsx(paused/error/done classes + updated snapshot),polishCss.test.ts(ring tokens + reduced-motion)npx eslinton touched files — clean;fallow audit --base origin/main— no issues in changed files