Roo-Code/src/services
Daniel bfbfaf6d46
fix: await MCP server initialization before returning McpHub instance (#11518)
* fix: await MCP server initialization before returning McpHub instance

MCP tools were unavailable on the first task turn when started via IPC
because McpHub's constructor fired initializeGlobalMcpServers() and
initializeProjectMcpServers() without awaiting them. getInstance()
returned a hub with servers still in "connecting" state.

Store the combined initialization promise and expose waitUntilReady(),
then await it in McpServerManager.getInstance() so the hub is only
returned after all servers have connected or timed out.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: assign McpHub instance only after waitUntilReady() resolves

Closes race condition where concurrent callers of getInstance() could
receive a hub that has not finished initialization. The hub is now
created in a local variable and only assigned to this.instance after
waitUntilReady() completes.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Roo Code <roomote@roocode.com>
2026-02-17 17:32:15 -07:00
..
checkpoints Add back post-revert bug fixes and features (Step 2) (#11463) 2026-02-13 18:40:28 -05:00
code-index Reapply Batch 1: 22 clean non-AI-SDK cherry-picks (#11473) 2026-02-14 13:47:12 -07:00
command feat: add optional mode field to slash command front matter (#10344) 2025-12-26 17:17:54 -08:00
glob fix: prevent stack overflow in codebase indexing for large projects (#7712) 2025-09-05 14:51:38 -04:00
marketplace Move @roo-code/cloud to the Roo-Code repo (#7503) 2025-08-28 11:18:45 -07:00
mcp fix: await MCP server initialization before returning McpHub instance (#11518) 2026-02-17 17:32:15 -07:00
mdm Refactor the extension bridge (#7515) 2025-08-29 00:28:38 -07:00
ripgrep fix: respect nested .gitignore files in search_files (#8804) 2025-10-24 16:16:22 -04:00
roo-config Add back post-revert bug fixes and features (Step 2) (#11463) 2026-02-13 18:40:28 -05:00
search Consistently use Package.name for better support of the nightly app (#9240) 2025-11-13 15:07:14 -05:00
skills Reapply Batches 3-4: Skills, browser removal, provider removals (6 major-conflict cherry-picks) (#11475) 2026-02-14 22:06:24 -07:00
tree-sitter chore: remove XML tool calling support (#10841) 2026-01-20 20:25:08 -05:00