Skip to content

Keep workspace-write access on cross-session MCP resume - #2099

Merged
RhysSullivan merged 1 commit into
mainfrom
fix/cross-session-resume-org-write
Sep 24, 2026
Merged

RhysSullivan merged 1 commit into
mainfrom
fix/cross-session-resume-org-write

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

When a model calls resume from a different MCP session than the one that started the execution (for example after an mcp-remote reconnect), the requester's session forwards the resume to the owning session via resumeExecutionForModel. That RPC ran engine.resume with no CurrentOrgWriteAccess bound, so the engine rebound the paused execution to the fail-closed "denied" default. An admin's pending addServer / addSpec / updateSpec then failed with org_write_denied.

  • The forwarded identity (McpModelResumeCaller) now carries the requester's orgWriteAccess, read from its own request context.
  • The owning session binds that value around engine.resume. A caller from the previous deploy that omits it is treated as denied.

Prod telemetry over the last 14 days: every always-gated admin write resumed through the cross-session path was denied. Same-session resumes were almost never denied.

Tests: new cases in agent-session-model-resume.test.ts cover allowed, denied, and a legacy caller. The allowed case fails without the fix. Typecheck is clean for @executor-js/cloudflare, apps/cloud, and apps/host-cloudflare.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@pkg-pr-new

pkg-pr-new Bot commented Sep 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

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

@executor-js/config

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

@executor-js/execution

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

@executor-js/sdk

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

@executor-js/codemode-core

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

@executor-js/runtime-quickjs

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

@executor-js/plugin-file-secrets

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

@executor-js/plugin-graphql

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

@executor-js/plugin-keychain

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

@executor-js/plugin-mcp

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

@executor-js/plugin-onepassword

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

@executor-js/plugin-openapi

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

executor

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

commit: 273b78d

@RhysSullivan
RhysSullivan marked this pull request as ready for review September 24, 2026 00:14
@RhysSullivan
RhysSullivan merged commit 9e143d9 into main Sep 24, 2026
79 of 80 checks passed
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