fix(mcp): keep wait_for_task_change alive past Claude Code's idle timeout
MCP_TOOL_TIMEOUT (raised by ClaudeDo's launchers) is a wall-clock cap unrelated to Claude Code's idle-silence abort (default 300s for HTTP-transport MCP servers), which no launcher raises. A wait near the 900s recommendation was silently killed at ~300s in any session, launcher or not. WaitForTaskChange now reports MCP progress every 30s while polling, which resets that idle timer. Verified against a real claude -p call (no launcher env overrides) surviving a 341s wait via 60s pings -- the same silence that previously aborted at 300s. Tool description and the list-handler prompt no longer claim ClaudeDo's launchers guarantee a long wait survives.
This commit is contained in:
@@ -482,7 +482,7 @@ public static class PromptFiles
|
||||
- Running or WaitingForChildren → leave it; the wait below covers it.
|
||||
- WaitingForReview → leave it; it goes straight to Phase 4.
|
||||
|
||||
Then wait with wait_for_task_change instead of sleeping and polling get_task yourself. Pass the ids of every task not yet in WaitingForReview or a terminal status — Queued, Running and WaitingForChildren alike — and set treatWaitingForChildrenAsBusy=true. Without that flag a task with children returns the moment it goes Running → WaitingForChildren, while its children are still working, and you would walk into Phase 4 with unfinished work. Use timeoutSeconds 900: the server clamps there anyway, and ClaudeDo's launchers already raise MCP_TOOL_TIMEOUT above it, so one long wait costs one turn where six short ones cost six.
|
||||
Then wait with wait_for_task_change instead of sleeping and polling get_task yourself. Pass the ids of every task not yet in WaitingForReview or a terminal status — Queued, Running and WaitingForChildren alike — and set treatWaitingForChildrenAsBusy=true. Without that flag a task with children returns the moment it goes Running → WaitingForChildren, while its children are still working, and you would walk into Phase 4 with unfinished work. Use timeoutSeconds 900: the server clamps there anyway, and it pings MCP progress every 30s while waiting so one long wait survives your client's own idle-silence abort and costs one turn where six short ones cost six.
|
||||
|
||||
It returns as soon as a task reaches WaitingForReview or fails, or reports timedOut if none did. Report progress as tasks land, then call it again with whatever ids are still outstanding until none remain.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user