Skip to content

Fix model approval resume across self-hosted MCP sessions - #2175

Open
ThomsenDrake wants to merge 2 commits into
UsefulSoftwareCo:mainfrom
ThomsenDrake:fix/selfhost-cross-session-resume
Open

ThomsenDrake wants to merge 2 commits into
UsefulSoftwareCo:mainfrom
ThomsenDrake:fix/selfhost-cross-session-resume

Conversation

@ThomsenDrake

@ThomsenDrake ThomsenDrake commented Oct 2, 2026 •

Copy link
Copy Markdown

Summary

An execution paused in one model-mode MCP session returns execution_not_found when the same client initializes another session before calling resume. Wire the existing resume fallback into the in-memory session store so the second session can resume the original live engine.

Lookup is restricted to the same authenticated account, organization, MCP resource, and model approval mode. It retains the resuming request's permissions, protects the owning session from idle eviction during resume, and uses the engine's existing in-flight/result replay behavior. Browser approval sessions remain excluded.

This is an in-process fix: it does not preserve executions across session disposal, process restarts, or different replicas. No approval requirement is removed.

Linked issue

Related to #1778.

Verification

  • bun run format:check
  • bun run lint
  • bun run typecheck — 45/45 tasks passed.
  • TURBO_TEST_CONCURRENCY=2 bun run test — 39/39 tasks passed.
  • bun run --cwd e2e test:selfhost scenarios/policy-tool-approval.test.ts — both scenarios passed. On self-host, the approval test initializes a second session, resumes, and retries the completed result; the decline test confirms no operation occurs. Sanitized HTTP trace (initial 401s are the test client's OAuth discovery).

Real-engine regression coverage includes cross-session resume/replay, ordinary execution, permission demotion, account/organization/resource isolation, browser-mode isolation, and a disposed owner session. Optional MCP debug logs now include the existing session/request join keys for execute and resume correlation.

The cloud approval scenarios also passed after restricting cross-session replay to self-host; cloud uses a separate owner directory. Full repository gates above ran at 645da79; the subsequent test-only change at 633ef3a passed formatting and both targeted suites. GitHub CI on the current head also passed, including the Docker build and all self-host/cloud/local end-to-end shards.

Checklist

  • No changeset needed: @executor-js/host-mcp is private and explicitly ignored by the changeset configuration.
  • Added or updated tests for the new behaviour.
  • No secrets, credentials, or private data in the diff.

This branch has not been deployed

No deployments
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