Files
codex/codex-rs/app-server/tests
Charlie Marsh 8fdf647295 Add per-chat leases for shared MCP connections (#57978)
## 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
2026-10-29 03:47:52 +00:00
..