fix(mcp): reclaim transport sessions and preserve recovery correlation
Test / Tests and coverage
Intrepid/Prometeu/Studio/pipeline/head This commit looks good

This commit is contained in:
2026-11-27 00:00:54 +00:00
parent fccfeca39d
commit a2494e7d70
6 changed files with 381 additions and 18 deletions
@@ -55,6 +55,23 @@ only the connection session, not project authority. Accepted notifications and
client responses return 202 without a body. Notification/disconnection alone
MUST NOT revoke a task or cancel an operation already returned by operationId.
The integrated connector MUST attempt authenticated DELETE before discarding a
known HTTP session on close, failed-connection recovery or descriptor replacement.
It MUST use that session's original endpoint and credential, bound cleanup to two
seconds and preserve the original outcome if cleanup fails. Closing is idempotent;
a closed connector MUST NOT reconnect through subsequent calls or background probes.
DELETE MUST NOT be substituted with task release or replay of a tool call.
The server MUST reclaim connection sessions after 60 seconds without transport
activity, as well as sessions whose credentials are inactive. A request already
being handled protects its session from idle expiration; completion renews the
idle period. Maintenance runs periodically and expired sessions are reclaimed
before session admission. Connector pings renew activity. Idle expiration returns
404 on subsequent use of the expired identity and never revokes project/task
authority, cancels admitted work or deletes task-local operation receipts. Clients
may initialize another connection and look up an existing receipt under the same
still-authorized task. The 128-session limit still applies to live connections.
The transport bounds incoming bodies to 1 MiB, sessions to 128 and request
handling to a bounded worker queue. Oversized bodies return 413; exhausted
session capacity returns 503. Stalled exchanges close after 15 seconds. These
@@ -97,6 +114,9 @@ reconnection. Calls cannot wait indefinitely for a grant. No reconnect path may
resubmit a tool call. An uncertain response MUST retain available clientRequestId
correlation and instruct receipt lookup within the same authorized task. A new
desktop/task has no old receipt registry and requires a fresh human grant.
Connector-generated uncertain-outcome errors carry that correlation in
`error.details.clientRequestId`, within the advertised output schema; the text
content block MUST serialize the identical structured envelope.
### 1.2 Stable Installation and Project Preparation