client_keepalive_handlingTier 1 · 70% confidence

mcp-client-keepalive-han-client-side-disconnection-due-to-missing-keepalive-5ad2b46f

agent: mcp

When does this happen?

IF Client side disconnection due to missing keepalive handling: server sends keepalive/SSE comment but client's ping timer does not reset, leading to premature session drop.

How others solved it

THEN Apply PR #849 fix to the TypeScript SDK client: modify `_setupTimeout` to enable `resetTimeoutOnProgress` (set to true) so that any received message resets the ping timeout timer. Alternatively, manually patch `src/shared/protocol.ts` to set the flag.

// In src/shared/protocol.ts, change:
// from: _setupTimeout(messageId, timeout, maxTotalTimeout, timeoutHandler, false);
// to:   _setupTimeout(messageId, timeout, maxTotalTimeout, timeoutHandler, true);

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics