Files
codex/codex-rs/rmcp-client
teddywyly-oai 358e3dd088 Recover when an MCP reply hits an expired HTTP session (#63782)
## Why

A Streamable HTTP server can return HTTP 404 when Codex replies to an
elicitation after the session expires. That reply has no waiting client
request to trigger session recovery, so in-flight tool calls can remain
pending.

## What changed

Close the expired transport and fail its in-flight calls without replaying
them. Reconnect on the next operation and count the handshake against that
operation's timeout. If the replacement session also returns HTTP 404 during
the operation, surface the failure without reconnecting again in the same
operation.

Attempt to delete sessions allocated during failed or cancelled recovery
handshakes.

## Testing

Add regression coverage for closing in-flight calls with a full inbound
queue, reconnecting without replay, enforcing the recovery deadline, and
cleaning up failed or cancelled handshakes while retaining healthy sessions.

GitOrigin-RevId: e6f8747644a85686ecea0a61d118fb02078d5442
2026-11-25 00:55:42 +00:00
..