Skip to content

Report executions lost to a session reset - #1978

Merged
RhysSullivan merged 1 commit into
mainfrom
lost-execution-visibility
Sep 11, 2026
Merged

Report executions lost to a session reset#1978
RhysSullivan merged 1 commit into
mainfrom
lost-execution-visibility

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

When the MCP session Durable Object is reset mid-execute (isolate memory or CPU limit, storage timeout, deploy), the front worker has already returned HTTP 200 with an SSE body. The socket to the DO closed, the bridge closed the writer, and the client got a cleanly terminated stream with no JSON-RPC response. Its recovery GET then resumed a stream with nothing to replay and hung on keepalives. Clients waited until their own timeout, or forever.

  • Front worker: track the request ids each POST owes. On any socket close other than the normal delivered close, or when a response deadline passes, write a -32010 error per outstanding id before closing. Happy path is byte-identical.
  • Durable Object: stamp the request-id ledger with an incarnation epoch. On the next GET, answer ids left by a previous incarnation with the same error and close the stream. Stale rows no longer extend the idle lease.
  • Classify the plain memory-limit reset as transient, like the CPU-limit one. The storage-cache variant stays unclassified.

Tests cover the bridge (abnormal close, unchanged happy path, deadline, deadline-constant drift), the epoch ledger, and the classifier. Not covered: an end-to-end scenario that resets a DO mid-execute; there is no hook for it.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 11, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 236fd9d Commit Preview URL

Branch Preview URL
Sep 11 2026, 10:55 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 11, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 236fd9d Sep 11 2026, 10:57 PM

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1978

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1978

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1978

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1978

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1978

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1978

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1978

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1978

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1978

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1978

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1978

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1978

executor

npm i https://pkg.pr.new/executor@1978

commit: 236fd9d

@RhysSullivan
RhysSullivan marked this pull request as ready for review September 11, 2026 23:05
@RhysSullivan
RhysSullivan merged commit f1d95f2 into main Sep 11, 2026
79 of 80 checks passed
@RhysSullivan
RhysSullivan deleted the lost-execution-visibility branch September 11, 2026 23:06
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