Add SSE stream node with two-phase ready/complete handles - #66
Merged
Merged
Conversation
- bridge.ts passed reg.input.shape to the SDK instead of the strict ZodObject, which let unknown keys slip past the router before rejection; pass the object itself - add tests covering unknown patch keys on addNodes/addEdges - guide.ts and tools.ts now walk through inserting a node and rewiring edges in one patch, since splitting it across calls can leave a branch disconnected - ignore app/tools
- Removed duplicated URL query-parameter assembly. - Added scoped, documented fallow suppressions for intentional SSE state-machine, traversal, and registry complexity/duplication. - Reused the SSE numeric input rendering helper.
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.
Problem
APIWeave couldn't test streaming APIs: there was no way to open an SSE connection, wait for it to be ready, trigger an action, and then assert on the events it emitted. Assertions and diagnosis logic were also hardcoded to only understand
http-requestas a response source.Solution
Adds a new
ssenode type: a bounded test listener (not a permanent subscription) that connects withAccept: text/event-stream, exposes areadyhandle (fires after the handshake, so a downstream trigger request can run without racing the subscription) and acompletehandle (fires once the bounded capture ends via event limit, a finish-condition rule match, or timeout). Captured events are structured (event,id,data) and addressable by assertions/extractors the same way an HTTP response body is.Details:
app/core/runner/sse.tsparses the SSE wire format (multi-linedata:,id:,retry:, fragmented chunks) with a 1 MiB capture cap.executor.tsruns SSE nodes as a background listener so thereadypath can continue immediately;safe_http.tsgained an opt-in zero-timeout mode for finish-condition-only waits.http-requestandsseinterchangeably as "response-producing" nodes.SseNodeData/SseFinishConditionshared types and zod schemas, canvas node (SseNode.tsx), node modal config panel (SseConfigPanel.tsx), palette entry, and JSON editor/docs updates.workflows_patchto reject unknown keys via full-object schemas (previously stripped silently), and documented a safe insert-and-rewire pattern in the authoring guide.Testing
app/core/runner/__tests__/executor_sse.test.tscovering fragmented multi-line events, non-matching event types, non-SSE content-type rejection, downstream assertion consumption, and the ready/trigger/finish-condition race.