Revert "perf(core): parallelize tool discovery"

This commit is contained in:
Sehoon Shon
2026-03-23 19:14:54 -04:00
parent 5b4fc18339
commit 7ff6f40ed0
+3 -12
View File
@@ -1288,27 +1288,18 @@ export class Config implements McpContext, AgentLoopContext {
// Initialize centralized FileDiscoveryService
const discoverToolsHandle = startupProfiler.start('discover_tools');
this.getFileService();
const discoveryPromises: Array<Promise<unknown>> = [];
if (this.getCheckpointingEnabled()) {
discoveryPromises.push(this.getGitService());
await this.getGitService();
}
this._promptRegistry = new PromptRegistry();
this._resourceRegistry = new ResourceRegistry();
this.agentRegistry = new AgentRegistry(this);
discoveryPromises.push(this.agentRegistry.initialize());
await this.agentRegistry.initialize();
coreEvents.on(CoreEvent.AgentsRefreshed, this.onAgentsRefreshed);
const toolRegistryPromise = this.createToolRegistry().then((registry) => {
this._toolRegistry = registry;
});
discoveryPromises.push(toolRegistryPromise);
await Promise.all(discoveryPromises);
this._toolRegistry = await this.createToolRegistry();
discoverToolsHandle?.end();
this.mcpClientManager = new McpClientManager(
this.clientVersion,