Skip to content

feat(runtime)!: report worker callback outcome instead of run state - #34

Merged
dylnslck merged 4 commits into
mainfrom
feat/effect-reliability
Oct 24, 2026
Merged

dylnslck merged 4 commits into
mainfrom
feat/effect-reliability

Conversation

@dylnslck

Copy link
Copy Markdown
Contributor

Summary

  • Worker callbacks now return { status: 'accepted' | 'stale' | 'cancelled', cancelRequested } so an attempt that has already been dispatched can learn it should stop. The host no longer sends the run state.
  • failEffect and worker fail callbacks can end the retry budget with nonRetryable, or wait at least retryAfterMs without shortening the policy backoff.
  • Heartbeats can carry details. The latest details stay on the execution record across retries and are included on the next worker task.

Test plan

  • bun x tsc -p packages/core/tsconfig.build.json --noEmit
  • bun x tsc -p packages/runtime/tsconfig.build.json --noEmit
  • bun x tsc -p packages/client/tsconfig.build.json --noEmit
  • bun test src in packages/core, packages/runtime, and packages/client
  • bun x oxlint on the changed sources with --deny-warnings
  • bun run verify for the full workspace (not run in this change; package checks above cover the touched packages)

Made with Cursor

BREAKING CHANGE: POST /runs/:runId/effects/:effectId/:attempt/:action returns { status, cancelRequested } instead of the run state. createLooms().workerCallback and the HTTP client return the same shape. Heartbeats may carry details that the next attempt's task includes. failEffect and worker fail callbacks can mark an attempt non-retryable or set retryAfterMs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dylnslck dylnslck mentioned this pull request Oct 23, 2026
2 tasks done
dylnslck and others added 3 commits October 23, 2026 14:13
The retry is scheduled from the wake's clock, which is read before the event timestamp, so comparing against the event could fail by a millisecond. The assertion also no longer skips when the payload is missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
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