fix(coding-agent): make prompt snippets opt in closes #2285

This commit is contained in:
Mario Zechner
2026-03-17 12:44:16 +01:00
parent 8e3bb4ff55
commit 7817e9b227
6 changed files with 67 additions and 6 deletions

View File

@@ -339,7 +339,7 @@ export interface ToolDefinition<TParams extends TSchema = TSchema, TDetails = un
label: string;
/** Description for LLM */
description: string;
/** Optional one-line snippet for the Available tools section in the default system prompt. Falls back to description when omitted. */
/** Optional one-line snippet for the Available tools section in the default system prompt. Custom tools are omitted from that section when this is not provided. */
promptSnippet?: string;
/** Optional guideline bullets appended to the default system prompt Guidelines section when this tool is active. */
promptGuidelines?: string[];

View File

@@ -94,9 +94,10 @@ export function buildSystemPrompt(options: BuildSystemPromptOptions = {}): strin
// Build tools list based on selected tools.
// Built-ins use toolDescriptions. Custom tools can provide one-line snippets.
const tools = selectedTools || ["read", "bash", "edit", "write"];
const visibleTools = tools.filter((name) => name in toolDescriptions || toolSnippets?.[name]);
const toolsList =
tools.length > 0
? tools
visibleTools.length > 0
? visibleTools
.map((name) => {
const snippet = toolSnippets?.[name] ?? toolDescriptions[name] ?? name;
return `- ${name}: ${snippet}`;