Repository navigation
Add per-chat leases for shared MCP connections - #57978
Merged
copyberry[bot] merged 1 commit intoOct 29, 2026
Merged
copyberry[bot] merged 1 commit into
copyberry[bot] merged 1 commit into
Conversation
## What changed Negotiate the `codex/connection-lease` extension for pooled stdio connections. For servers that advertise it, open a unique lease per chat and attach its host-owned ID to tool calls and resource reads via `codex/connectionLease`, overriding caller-supplied lease metadata. When a chat releases its lease, write cancellations for pending requests before sending `codex/connection/release`. Preserve open-before-release ordering across startup timeouts, bound unload waits, and remove connections from the pool when lease cleanup fails or times out. Servers without the extension retain existing behavior. ## Testing Add coverage for cancellation-before-release ordering, late open acknowledgements, and lease drops outside the runtime. Extend app-server sharing tests to verify distinct chat leases, metadata replacement, release on unload, and continued use by another chat. GitOrigin-RevId: f4c8b606cb98b5697acab1c515e992ff80ec8425
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/f4c8b606cb98b5697acab1c515e992ff80ec8425
branch
from
October 29, 2026 03:48
6c720ce to
8fdf647
Compare
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/f4c8b606cb98b5697acab1c515e992ff80ec8425
branch
October 29, 2026 03:48
espentuft
temporarily deployed
to
issue-triage
October 29, 2026 03:56 — with
GitHub Actions
Inactive
espentuft
temporarily deployed
to
issue-triage
October 29, 2026 03:56 — with
GitHub Actions
Inactive
espentuft
temporarily deployed
to
issue-triage
October 29, 2026 03:56 — with
GitHub Actions
Inactive
0wnerDied
temporarily deployed
to
issue-triage
October 29, 2026 03:59 — with
GitHub Actions
Inactive
0wnerDied
temporarily deployed
to
issue-triage
October 29, 2026 03:59 — with
GitHub Actions
Inactive
0wnerDied
temporarily deployed
to
issue-triage
October 29, 2026 03:59 — with
GitHub Actions
Inactive
GGBondBlueWhale
temporarily deployed
to
issue-triage
October 29, 2026 04:04 — with
GitHub Actions
Inactive
GGBondBlueWhale
temporarily deployed
to
issue-triage
October 29, 2026 04:04 — with
GitHub Actions
Inactive
GGBondBlueWhale
temporarily deployed
to
issue-triage
October 29, 2026 04:04 — with
GitHub Actions
Inactive
GGBondBlueWhale
temporarily deployed
to
issue-triage
October 29, 2026 04:05 — with
GitHub Actions
Inactive
LIUYOU2015
temporarily deployed
to
issue-triage
October 29, 2026 04:11 — with
GitHub Actions
Inactive
LIUYOU2015
temporarily deployed
to
issue-triage
October 29, 2026 04:11 — with
GitHub Actions
Inactive
LIUYOU2015
temporarily deployed
to
issue-triage
October 29, 2026 04:11 — with
GitHub Actions
Inactive
LIUYOU2015
temporarily deployed
to
issue-triage
October 29, 2026 04:12 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add per-chat leases for shared MCP connections
What changed
Negotiate the
codex/connection-leaseextension for pooled stdio connections. For servers that advertise it, open a unique lease per chat and attach its host-owned ID to tool calls and resource reads viacodex/connectionLease, overriding caller-supplied lease metadata.When a chat releases its lease, write cancellations for pending requests before sending
codex/connection/release. Preserve open-before-release ordering across startup timeouts, bound unload waits, and remove connections from the pool when lease cleanup fails or times out. Servers without the extension retain existing behavior.Testing
Add coverage for cancellation-before-release ordering, late open acknowledgements, and lease drops outside the runtime. Extend app-server sharing tests to verify distinct chat leases, metadata replacement, release on unload, and continued use by another chat.