fix(coding-agent): make prompt snippets opt in closes #2285
This commit is contained in:
@@ -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[];
|
||||
|
||||
@@ -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}`;
|
||||
|
||||
Reference in New Issue
Block a user