fix(mcp): increase preflight timeout and retry initialize - #479
Merged
andresharpe merged 3 commits intoJun 11, 2026
Merged
Conversation
andresharpe
approved these changes
Jun 11, 2026
This was referenced Jun 19, 2026
This was referenced Jun 19, 2026
carlospedreira
pushed a commit
that referenced
this pull request
Jun 23, 2026
….exe Claude Code's MCP client uses a short default connection timeout (~5s), but the dotbot stdio MCP server cold-starts in 12-30s. The per-task claude.exe spawned its own MCP init before mcp__dotbot__* tools loaded, making them permanently unavailable for that task session. Inject MCP_TIMEOUT (60s) and MCP_TOOL_TIMEOUT (30s) into the per-task process environment, guarded by ContainsKey so operator-set values win. Independent of the preflight readiness check (PR #479). Closes #521
carlospedreira
pushed a commit
that referenced
this pull request
Jun 25, 2026
Test-DotbotMcpReadiness set DOTBOT_PROJECT_ROOT to the worktree path when spawning the standalone preflight MCP process. On task retry the worktree's .control junction can be stale (teardown/re-create is not atomic), so the MCP server fails to resolve runtime.json and exits before the handshake begins — the 2-attempt retry loop from #479 cannot help because the process dies pre-handshake. This also bypassed #356: Resolve-ProjectRoot returns DOTBOT_PROJECT_ROOT verbatim when set, skipping git-common-dir detection entirely. Add an optional -ProjectRoot parameter to Test-DotbotMcpReadiness and pass the main project root at the call site. The main root always has a stable .control/ directory, so runtime.json resolution keeps working on retry. Backward compatible: callers that omit -ProjectRoot fall back to the worktree path. Closes #515
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Closes #473
Summary of changes
Read-DotbotMcpPreflightLinehad a hardcoded 5s timeout introduced inef80c06. When worktree file copy runs slow under I/O load (~9s), coldpwshstartup for the MCP server exceeds that window — first run fails, retry succeeds because the worktree already exists.Two fixes in
Invoke-WorkflowProcess.ps1:TimeoutMsraised from 5 000 → 15 000 msinitializeRPC retries once before failing; logs first failure at Debug levelTesting notes
dotbot go) with no existing worktree for the taskinitialize_failederrorChecklist