Skip to content

fix(sdk): accept a suspended known status in readCompletedStepOutput (main typecheck) - #592

Merged
khaliqgant merged 2 commits into
mainfrom
fix/authored-known-status-suspended
Sep 30, 2026
Merged

khaliqgant merged 2 commits into
mainfrom
fix/authored-known-status-suspended

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Why

main stopped typechecking at 78b677a, right after #590 merged. Relayflow v2 surface package › packed-consumer failed, and so did the Cloud runtime artifact and the Publish Package build (Build SDK against packed surface):

src/authored-worker-step.ts(143,88): error TS2345: Argument of type 'RunStatus | "suspended" | undefined' is not assignable to parameter of type 'RunStatus | undefined'.

How main got broken

Neither PR was wrong on its own; this is a semantic merge conflict.

Suggestion: turn on branch protection for main with "Require branches to be up to date before merging" (or a merge queue), so the required checks always run against the actual merge result.

Fix

  • knownStatus?: RunStatus | 'suspended'.
  • suspended is the authored root's Event Await boundary (suspendedExecution, exit 4), never a terminal verdict. A single-step child kernel run does not journal it, so on this path it is type-level only.
  • If it ever arrives, it is judged exactly like a run still in flight: the read-only wait runs, and a producer success is refused until the child run is terminal.

Verification

  • tsc --noEmit, tsc -p tsconfig.type-tests.json and tsc -p tsconfig.tests.json are clean against the local Surface build. Without the change there is exactly the one error above.
  • New regression tests in tests/authored-step-terminal-completion.test.ts, under "readCompletedStepOutput given a suspended known status (feat: add durable Event Await suspension protocol #441)":
    • keeps waiting and resolves only once the child run is terminal
    • refuses a producer success while the child is still not terminal
  • authored-step-terminal-completion + authored-node-result: 57/57 pass. Full npm test and the Cloud real-runtime deadline-resume e2e results will be posted as a comment.

🤖 Generated with Claude Code

#590 and #441 merged in the same window: #441 widened RunReport.status to
include 'suspended', and #590's reader took the caller's known status as a
bare RunStatus, so main no longer typechecks
(authored-worker-step.ts:143). A suspended child is not terminal and is
judged like one still in flight.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: af5d90c4-7aab-4662-b5bc-276c5a18f2f3


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T10:38:53.071271Z 75afea0 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

… check

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@khaliqgant

Copy link
Copy Markdown
Member Author

Verification on this head (b-tests + real runtime)

  • Typecheck: tsc --noEmit, type-tests and tests configs are clean. main without this change fails exactly the TS2345 above.
  • CI: packed-consumer, the job that broke on main, passes here, as does validate.
  • Runtime: the change is type-only. The emitted dist/authored-step-output.js differs from main's only by a line break where the stripped annotation was.
  • Full local npm test: 3559 passed, 14 failed. The failures are all live-daemon suites (webhook-live, event-await CLI, provider-trigger, MCP live, live-kernel, communication resume) plus the known bun-version and network tests. Since the change doesn't alter runtime, they are environmental on this machine; CI is the authority.
  • Cloud real-runtime e2e (cloud/packages/core/tests/relayflow-v2-real-deadline-resume.test.ts), run against this head with a relayflowd built from it (includes feat: add durable Event Await suspension protocol #441):
    • The deadline kill names run-2.
    • The pointerless 3-journal legacy state resumes to {"status":"completed","completionReason":"success","completedSteps":3,"subscriptions":[]}.
    • Step 1 is not re-run. ℹ pass 1 ℹ fail 0.

@khaliqgant

Copy link
Copy Markdown
Member Author

@codex review

@khaliqgant
khaliqgant merged commit 09121b1 into main Sep 30, 2026
9 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 75afea02be

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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