SummaryOn base image 0.8.0, an agent that has a long-lived remote MCP connection configured in Crucially: the MCP tool calls themselves succeed — this is purely an output-capture/subprocess-lifecycle problem, not an MCP connectivity problem. Environment
SymptomEvery execution (even a no-tool "reply READY" task — The execution record then shows The work actually completed (key evidence)The remote MCP server's own request logs show the agent's So Reproduces with / does NOT reproduce
That contrast points at a persistent/keep-alive MCP connection (an idle HTTP keep-alive socket or a persistent stdio child) holding the stdout pipe fd / keeping a reader thread alive, so Questions
Thanks — otherwise 0.8.0 has been solid; this is the one thing blocking an agent that depends on a remote MCP backend. |
Replies: 2 comments
|
Opened a fix PR for this: #1718 — runs the cgroup orphan sweep before the pipe close (so the blocked reader EOFs and releases the TextIOWrapper lock) and bounds every |
|
Thanks — this is a model bug report, and the PR on top of it is even better. Answers in order: 1. Known issue / fixed in a newer image? The class is known — #728 (OAuth-failure CPU spin) and its residual #1502 (budget-exceeded drain leaking a reader thread) are both closed — but your trigger is genuinely distinct: a persistent MCP connection (idle keep-alive socket or persistent stdio child) keeping the reader thread from EOFing, so 2. Recommended pattern / workaround? There's no config-side workaround I'd recommend — the fix belongs in the drain path, and your PR has the right shape (sweep cgroup orphans before the pipe close so the blocked reader EOFs, and bound every close path). If you need to unblock your agent before it ships in a release: the drain code lives entirely in the agent base image, so you can build the base image from your branch ( 3. Separate issue? No need — #1718 is the tracked artifact now, and its fork-based regression test covers the repro. Keep the minimal FastMCP repro handy though; it's useful if review turns anything up. The one thing blocking merge: as I noted on the PR, the branch was cut from git fetch upstream dev && git rebase upstream/dev && git push --force-with-leaseOnce that's pushed, the nightly suite re-runs, this can land, and the fix rides the next base-image release. |
Thanks — this is a model bug report, and the PR on top of it is even better. Answers in order:
1. Known issue / fixed in a newer image? The class is known — #728 (OAuth-failure CPU spin) and its residual #1502 (budget-exceeded drain leaking a reader thread) are both closed — but your trigger is genuinely distinct: a persistent MCP connection (idle keep-alive socket or persistent stdio child) keeping the reader thread from EOFing, so
safe_close_pipesdeadlocks on theTextIOWrapperlock exactly as you diagnosed. No released base image fixes this yet — 0.8.0 is current — so your #1718 is the fix, not a duplicate of one already in flight.2. Recommended pattern / workaround? There's no config…