mirror of
https://github.com/colbymchenry/codegraph.git
synced 2026-10-18 13:53:01 +08:00
fix(mcp): resolve the pool's project root only when the pool serves the call (#2027)
The #1465 change read the default project root on every tool call, before checking whether a query worker would serve it. Resolve it only for a pooled call; in-process dispatch no longer depends on it (restores the oversized-output truncation test). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+4
-3
@@ -2228,9 +2228,10 @@ export class ToolHandler {
|
||||
// The default may have appeared after the workers started. Pass the
|
||||
// main thread's current root explicitly; with no root or projectPath,
|
||||
// keep the main handler's workspace-specific not-indexed guidance.
|
||||
const projectPath = args.projectPath ?? this.cg?.getProjectRoot();
|
||||
const raw = (projectPath && this.queryPool && this.queryPool.healthy && this.queryPool.ready)
|
||||
? await this.queryPool.run(toolName, { ...dispatchArgs, projectPath })
|
||||
const pooled = !!(this.queryPool && this.queryPool.healthy && this.queryPool.ready);
|
||||
const projectPath = pooled ? args.projectPath ?? this.cg?.getProjectRoot() : undefined;
|
||||
const raw = (pooled && projectPath)
|
||||
? await this.queryPool!.run(toolName, { ...dispatchArgs, projectPath })
|
||||
: await this.executeReadTool(toolName, dispatchArgs);
|
||||
// Record + STRIP before anything else touches the result: the emission is
|
||||
// internal bookkeeping and must never reach the client, whether or not a
|
||||
|
||||
Reference in New Issue
Block a user