diff --git a/__tests__/explore-output-budget.test.ts b/__tests__/explore-output-budget.test.ts index efe302fb7..7843bebd2 100644 --- a/__tests__/explore-output-budget.test.ts +++ b/__tests__/explore-output-budget.test.ts @@ -197,7 +197,10 @@ describe('codegraph_explore output respects the adaptive budget', () => { const result = await handler.execute('codegraph_explore', { query: 'Session method helper' }); const text = result.content?.[0]?.text ?? ''; expect(text).not.toContain('### Additional relevant files'); - expect(text).not.toContain('Complete source code is included above'); + // The completeness note, which reads "Complete source for 1 file is + // included above…" on this fixture ("Verbatim source for N files…" after + // a trim). + expect(text).not.toContain('is included above'); expect(text).not.toContain('advisory only, NOT a quota'); }); @@ -213,6 +216,9 @@ describe('codegraph_explore output respects the adaptive budget', () => { const text = result.content?.[0]?.text ?? ''; expect(text).toContain('advisory only, NOT a quota'); expect(text).toContain('extra calls are never rejected or rate-limited'); + // The completeness note is on here, so the small tier's check for its + // absence above still names text the note has. + expect(text).toContain('is included above'); expect(text).not.toContain('remaining calls'); expect(text).not.toContain('Synthesize once'); } finally { diff --git a/src/mcp/tools.ts b/src/mcp/tools.ts index e15c8386d..5adf1cfb2 100644 --- a/src/mcp/tools.ts +++ b/src/mcp/tools.ts @@ -296,7 +296,7 @@ export interface ExploreOutputBudget { includeRelationships: boolean; /** Include the "Additional relevant files (not shown)" trailing list. */ includeAdditionalFiles: boolean; - /** Include the "Complete source code is included above…" reminder. */ + /** Include the "… source for N files is included above" reminder. */ includeCompletenessSignal: boolean; /** * Include the advisory exploration-guidance note at the end. Purely @@ -1832,12 +1832,11 @@ export const tools: ToolDefinition[] = [ properties: { query: { type: 'string', - description: 'Symbol names, file names, or short code terms to explore (e.g., "AuthService loginUser session-manager", "GraphTraverser BFS impact traversal.ts"). For a flow question, name the symbols spanning the flow (e.g. "mutateElement renderScene"). A natural-language question works too — no prior codegraph_search needed.', + description: 'Symbol names, file names, or short code terms to explore (e.g., "AuthService loginUser session-manager", "GraphTraverser BFS impact traversal.ts"). For a flow question, name the symbols spanning the flow (e.g. "mutateElement renderScene"). A natural-language question works too.', }, maxFiles: { type: 'number', - description: 'Maximum number of files to include source code from (default: 12)', - default: 12, + description: 'Maximum number of files to return source from, 1–20. Omit it to use a default sized to the project (4 files below 150 indexed files, 5 below 500, 8 otherwise). Total output is also capped by characters (about 13K–24K by project size), so a higher maxFiles spreads that budget over more files rather than returning more text.', }, projectPath: projectPathProperty, },