Skip to content

fix(cli): resume async polling and artifacts - #87

Merged
ThomasRooney merged 4 commits into
mainfrom
fix/cli-status-stream-default
Oct 8, 2026
Merged

ThomasRooney merged 4 commits into
mainfrom
fix/cli-status-stream-default

Conversation

@ThomasRooney

@ThomasRooney ThomasRooney commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Why

An async command could return a handle, but its recovery hint pointed to a one-shot polling command that lost the original waiting and artifact-output settings. Stream-capable commands also decoded JSON against generated types before honoring explicit JSON or jq output, so otherwise valid responses could fail on schema changes.

What changed

Async commands now accept --resume <id> to poll an existing operation with the original recipe and output settings. Resume skips creation, required create inputs, stdin and interactive prompts; it rejects conflicting inputs before making requests. Help and usage describe resume on the flag itself; conflict errors explain invalid combinations. Artifact destinations must be supplied again with --out; existing URI-only artifact errors are preserved.

Raw JSON preparation now runs before stream dispatch. Actual SSE and JSONL responses continue through their streaming handlers. The generated review fixture and runtime tests cover resume, output modes, validation, dry runs, safe recovery hints and mixed-response behavior.

The generated help uses this flag description, with no additional resume paragraph:

--resume string   Resume polling an existing operation by ID instead of creating one

Testing

  • Focused extension and generated CLI regression tests passed. The new resume and JSON/jq regressions fail against the baseline generated fixture.
  • TARGET=review make test-cli passed: 644 tests, with two existing incomplete-workflow skips.
  • TARGET=primary make test-cli passed: 1,656 tests, including the counted JSONL regression. Review usage checks and both coverage checks passed.
  • make check-template-cli, npm run format, and make lint passed.
  • Regenerated CLI non-live validation passed; local mock checks covered status output, no-create resumption, artifact bytes, streaming, dry runs and input validation.
  • Compact flag help passed focused help/conflict tests, the full review and primary CLI suites, and regenerated CLI non-live validation.
  • Platform-guard changes passed focused generated tests and Windows cross-compilation; no native Windows runtime run was performed.

Public-safety check

  • This change contains no credentials, customer documents, private repository URLs, private filesystem paths, or unredacted private logs.
  • Title, body, comments, and commit messages name no customers or customer-derived identifiers, private paths or trackers, or workflow provenance, and are understandable without private context (.claude/skills/public-repo-communication/SKILL.md).
  • Generated fixtures and review SDK changes are public-safe.
  • I reviewed git diff --check.

Summary by cubic

Tracks async operation resumption so polling and artifact settings survive an escape or timeout, and prevents stream-capable commands from failing on explicit JSON/jq output when the response drifts from the generated schema.

  • Async commands accept --resume <id>, which polls an existing operation without creating another; it skips create inputs, stdin, and interactive prompts and rejects conflicting flags, with help text describing the resume flow.
  • The one-shot recovery hint (cli get-asset --id) is replaced by --resume; artifact destinations must be supplied again with --out, and async notices now print their resume command to stderr so machine-mode stdout stays clean.
  • Raw response handling now runs before stream dispatch, so -o json/--jq works on stream-capable operations even when the schema changed, while SSE and JSONL responses still stream normally.

Written for commit 8109b48. Summary will update on new commits.

View guided diff Turn on auto-fix

@ThomasRooney
ThomasRooney requested a review from a team as a code owner October 7, 2026 15:25

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 28 files

Shadow auto-approve: would not auto-approve because issues were found.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread zSDKs/sdk-cli/docs/cli_produce.md Outdated
Comment thread templates/templates/cli/async_test.go.stmpl

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 11 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Fixes async CLI recovery by adding --resume with original polling/artifact settings and moves raw JSON handling ahead of stream dispatch; the change is bounded and backed by extensive generated and runtime tests.

View guided diff | Turn on auto-fix | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 11 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Bounded CLI fix adding --resume to async commands so escaped/timed-out operations resume with original polling and artifact settings, plus raw JSON handling before stream dispatch; extensive generated and runtime tests cover the new behavior.

View guided diff | Turn on auto-fix | Re-trigger cubic

@2ynn 2ynn 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.

Nonblocking coverage gaps

  • Second operation dispatch path: the schema-mismatch regression exercises the polling operation's direct command. Both the ordinary operation path and the async-capable operation executor move raw-JSON preparation. A direct render-asset JSON/jq call receiving schema-mismatched JSON would protect the latter independently.
  • Validation classification: conflict cases assert an error and zero requests, correctly protecting side effects. They do not assert CLI_VALIDATION; an unrelated early error could satisfy those checks.
  • Help/schema semantics: help and usage assertions use text containment. A structural schema assertion would better protect optional create arguments and the alternate resume input contract.
  • Windows: the printed-hint execution test intentionally skips shell execution on Windows. Cross-compilation does not verify native shell quoting; this is a stated validation limit, not a newly established defect.

Comment thread zSDKs/sdk-cli/tests/async_test.go Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files (changes from recent commits).

Shadow auto-approve: would not auto-approve because issues were found.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread templates/templates/cli/async_test.go.stmpl
@ThomasRooney
ThomasRooney force-pushed the fix/cli-status-stream-default branch from 1ef1735 to 8109b48 Compare October 7, 2026 23:15
@ThomasRooney
ThomasRooney added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit 9419553 Oct 8, 2026
451 of 455 checks passed
@ThomasRooney
ThomasRooney deleted the fix/cli-status-stream-default branch October 8, 2026 17:05
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants