fix: increase MCP idle timeout to 10 minutes (#148)#166
fix: increase MCP idle timeout to 10 minutes (#148)#166
Conversation
Benchmark Regression ReportThreshold: 10.00%
|
Two changes: 1. Idle timeout increased from 2min to 10min — allows long debugging sessions where the agent thinks for >2min 2. Watchdog now polls stdin every 10s for POLLHUP — detects dead clients immediately instead of waiting for the full timeout. When the client pipe closes, server exits within 10 seconds. This means: - Client disconnects cleanly → stdin EOF → server exits immediately - Client crashes/killed → POLLHUP detected → server exits in ≤10s - Client connected but idle → 10min timeout (plenty for debugging) - Orphaned process (no client ever) → 10min timeout Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1c16117 to
8754cf1
Compare
Benchmark Regression ReportThreshold: 10.00%
|
- Verify idle_timeout_ms is 10 minutes (600,000ms) - Verify POLLHUP detected when pipe write end is closed (client gone) - Verify open pipe does NOT trigger false HUP Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
516a874 to
252a9f1
Compare
Benchmark Regression ReportThreshold: 10.00%
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 252a9f1fed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Wait up to 15 seconds for the process to exit | ||
| // (watchdog polls every 10s, so it should detect POLLHUP within ~10s) | ||
| const start = std.time.milliTimestamp(); | ||
| const term = child.wait() catch { |
There was a problem hiding this comment.
Add a real timeout when waiting for MCP child exit
This test claims to "wait up to 15 seconds," but child.wait() is unbounded and can block forever. If codedb mcp fails to exit after stdin closes (the exact regression this test is meant to catch), the test will hang the suite/CI instead of failing fast. Please use a deadline-based wait loop (e.g., tryWait + sleep, then kill/fail at 15s) so timeouts are enforced.
Useful? React with 👍 / 👎.
Summary
Fixes #148 — MCP server disconnects during debugging sessions + orphaned processes linger.
Two fixes:
1. Idle timeout: 2min → 10min
Agents thinking for >2min during debugging would lose the MCP connection. 10 minutes is enough for any debugging session.
2. stdin poll for dead client detection
Watchdog now polls stdin every 10 seconds for
POLLHUP. When the client pipe closes (crash, kill, disconnect), server exits within 10 seconds — no more dangling processes.Behavior matrix:
Why this is safe:
1 file changed, ~20 lines.