Skip to content

Fix cross-session resume lease cleanup deleting the owner entry#1314

Merged
RhysSullivan merged 1 commit into
mainfrom
resume-cross-session-e2e
Jul 4, 2026
Merged

Fix cross-session resume lease cleanup deleting the owner entry#1314
RhysSullivan merged 1 commit into
mainfrom
resume-cross-session-e2e

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Problem

Cross-session resume still failed in production after #1312. Root cause: when the resume arrives on a session that does not own the execution, the local engine miss triggers the resume lifecycle's settle hook, and releasePendingApprovalLease treated "no local lease" as permission to delete the owner-directory entry. Session B deleted session A's entry, then the directory fallback read null and returned execution_not_found.

Found via a new worker-level e2e that runs the real worker with real Durable Objects and two real MCP sessions (pause on A, resume on B). Red before the fix with exactly the production symptom; green after.

Fix

  • releasePendingApprovalLease no longer deletes the directory entry when there is no local lease; deletion happens only when the owning session releases its lease.
  • Directory put/get/delete failures and forward failures/timeouts now emit structured console.error events (mcp_execution_owner_directory_error, mcp_model_resume_forward_error) and span annotations, so this class of silent degradation is diagnosable in production telemetry.
  • The two-session worker e2e stays in the suite as the regression gate.

Tests

typecheck 42/42, lint clean, hosts/mcp 64, hosts/cloudflare 29, new e2e green.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 4, 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 94e12c9 Jul 04 2026, 08:22 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 4, 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 94e12c9 Commit Preview URL

Branch Preview URL
Jul 04 2026, 08:21 AM

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@pkg-pr-new

pkg-pr-new Bot commented Jul 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

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

@executor-js/config

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

@executor-js/execution

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

@executor-js/sdk

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

@executor-js/codemode-core

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

@executor-js/runtime-quickjs

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

@executor-js/plugin-file-secrets

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

@executor-js/plugin-graphql

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

@executor-js/plugin-keychain

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

@executor-js/plugin-mcp

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

@executor-js/plugin-onepassword

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

@executor-js/plugin-openapi

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

executor

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

commit: 94e12c9

@RhysSullivan RhysSullivan marked this pull request as ready for review July 4, 2026 08:26
@RhysSullivan RhysSullivan merged commit 52f30f0 into main Jul 4, 2026
21 checks passed
@RhysSullivan RhysSullivan deleted the resume-cross-session-e2e branch July 4, 2026 08:26
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