Skip to content

fix DO connection io#887

Merged
RhysSullivan merged 1 commit into
mainfrom
rs/fix-mcp-org-auth-connection-reuse
Jun 2, 2026
Merged

fix DO connection io#887
RhysSullivan merged 1 commit into
mainfrom
rs/fix-mcp-org-auth-connection-reuse

Conversation

@RhysSullivan
Copy link
Copy Markdown
Owner

No description provided.

McpOrganizationAuthLive is built once by the facade but its authorize runs on
every MCP request. It provided a module-const services layer (DbService.Live +
UserStoreService.Live); the long-lived runtime's memo map memoizes those const
layers once, so the postgres socket opened on the first request is reused on
later ones — illegal under Cloudflare's per-request I/O ("Cannot perform I/O on
behalf of a different request"). The org lookup then fails on every follow-up,
so the session connects but tools/list 403s ("connected, tools fetch failed").

Build the DB + UserStore layers fresh per authorize call (distinct layer values
bypass memoization) so each request gets its own request-scoped socket.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 2, 2026

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 e6902a1 Commit Preview URL

Branch Preview URL
Jun 02 2026, 08:32 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 2, 2026

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 e6902a1 Jun 02 2026, 08:33 PM

@RhysSullivan RhysSullivan changed the title Fix MCP org-auth DB connection reuse across requests fix DO connection io Jun 2, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 2, 2026

Open in StackBlitz

@executor-js/cli

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

@executor-js/config

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

@executor-js/execution

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

@executor-js/sdk

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

@executor-js/codemode-core

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

@executor-js/runtime-quickjs

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

@executor-js/plugin-file-secrets

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

@executor-js/plugin-graphql

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

@executor-js/plugin-keychain

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

@executor-js/plugin-mcp

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

@executor-js/plugin-onepassword

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

@executor-js/plugin-openapi

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

executor

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

commit: e6902a1

@RhysSullivan RhysSullivan marked this pull request as ready for review June 2, 2026 20:36
@RhysSullivan RhysSullivan merged commit bec7b7b into main Jun 2, 2026
11 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