fix(examples): capture the connector response on the two showcase REST ping flows - #7618
Merged
Merged
Conversation
…T ping flows (#7542) `TaskCompletedRestPingFlow` and `ShowcaseDeclarativeConnectorPingFlow` both claimed in their source comments that the call and its `{ status: 'ok' }` response were captured on the flow run. Neither declared any variables, and the engine collects `run.output` from declared `isOutput` variables only — so `run.output` came back empty and the comment pointed the next reader at an engine bug that does not exist. Both flows now declare the output variable they were evidently meant to carry, mirroring the sibling `ShowcaseMcpConnectorEchoFlow`. The name follows what the step actually produces: the `rest` connector's `request` action returns `{ status, ok, body }`, written back under `${nodeId}.${key}`, and both flows' connector node is `ping` — so `ping.body` is the parsed health payload. New test drives the real flow definitions through a real `AutomationEngine` with the real `createRestConnector` / `createRestProviderFactory` bundles (only `fetch` stubbed) and content-pins `run.output` to `{ status: 'ok' }`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015fkdTyGmMD5s8ZtEifvuGy
…wcase-flow-isoutput
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
os-help
marked this pull request as ready for review
August 11, 2026 09:39
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.
Fixes #7542
What was wrong
TaskCompletedRestPingFlowandShowcaseDeclarativeConnectorPingFlowinexamples/app-showcase/src/automation/flows/index.tsboth told the reader that the call and its{ status: 'ok' }response were captured on the flow run. Neither flow declared anyvariablesat all.run.outputis not a free side effect of dispatching. The engine collects it from the flow's declaredisOutputvariables only —AutomationEngine.execute, "Collect output variables":So both flows dispatched fine and returned an empty
run.output, while the comment said the response was there — which sends the next reader hunting for an engine bug that does not exist. The siblingShowcaseMcpConnectorEchoFlowis the proof it was authoring and not engine: same dispatch path, one declared variable, captured output.The fix
Route 1 from the issue (the preferred one): declare the output variable both flows were evidently meant to carry.
The name was derived from what the step actually produces, not copied from the contrast fixture.
connector_actionwrites a node's handler output back under${nodeId}.${key}(engine.ts), therestconnector'srequestaction returns{ status, ok, body }(packages/connectors/connector-rest/src/rest-connector.ts), and both flows' connector node id isping— so the response payload isping.body.showcase_status_apiis materialized by the samecreateRestConnectorbundle throughcreateRestProviderFactory, so the declarative flow is identical in this respect.The comments were tightened alongside to name the variable, so the claim and the declaration cannot drift apart again.
Route 2 (weaken the comments) was measured and rejected: the capture works perfectly for these flows once asked for — see the verification below.
Verification — runtime capture, not schema validity
New file
examples/app-showcase/test/connector-ping-run-output.test.ts. It drives the real flow definitions imported fromsrc/automation/flows/index.tsthrough a realAutomationEnginewith the real connector bundles —createRestConnectorfor the pluginrestconnector, andcreateRestProviderFactoryfed the realStatusApiConnectormetadata for the ADR-0097 instance. Onlyfetchis stubbed, so the handler's{ status, ok, body }output shape is the shipped one. The assertion is a content pin on the captured value:This is the runtime-capture level, not the schema level — an actual run of both flows, with the response value pinned. A booted app was not needed.
Reverse verification (predicted direction: red, with an empty output) — the fix was taken out with a path-scoped
git checkout origin/main, nevergit stash:3/3 red, and the two dispatch cases fail with
run.output={}— the issue's reported symptom reproduced verbatim — while the recorded outbound request was still there, confirming dispatch itself was never the defect. Fix restored: 3/3 green.Full local runs:
pnpm --filter @objectstack/example-showcase test→ 18 files, 171 tests passedpnpm --filter @objectstack/example-showcase typecheck→ cleanpnpm --filter @objectstack/example-showcase validate→ exit 0 (only pre-existing unrelated warnings)node scripts/check-nul-bytes.mjs→ OKNotes
examples/app-showcaseisprivate: trueand publishes nothing, so this is theskip-changesetlabel route (label applied on this PR).src/system/connectors/is untouched — that is batch-mate Showcase REST connectors hard-wirebaseUrltohttp://127.0.0.1:3000, so self-ping flows failfetch failedon any isolated instance — a port mismatch, not an egress block #7538'sbaseUrlfix.origin/mainwas merged before opening this PR. The test readsStatusApiConnectorbut asserts only the flow-owned path (/api/v1/health), so it stays green across an env-overridablebaseUrl.docs/qa/platform-checklist/areas/automation.json(connector-dispatch-matrix) asserts that the rest ping and declarative ping both recordGET /api/v1/health→{status:'ok'}. Under route 1 that clause becomes true as written, so it needed no edit — route 2 would have required changing it.Generated by Claude Code