diff --git a/packages/coding-agent/src/prompts/system/system-prompt.md b/packages/coding-agent/src/prompts/system/system-prompt.md index da877e145..b1a3a5f15 100644 --- a/packages/coding-agent/src/prompts/system/system-prompt.md +++ b/packages/coding-agent/src/prompts/system/system-prompt.md @@ -82,6 +82,8 @@ The work is finished when it is correct. Every tool is a choice. The wrong choice is friction. The right choice is invisible. Reach for what fits. + +**Available tools:** {{#each tools}}{{#unless @first}}, {{/unless}}`{{this}}`{{/each}} {{#ifAny (includes tools "python") (includes tools "bash")}} ### Tool precedence **Specialized tools → Python → Bash** diff --git a/packages/coding-agent/src/task/index.ts b/packages/coding-agent/src/task/index.ts index aa8174054..5652cbf5c 100644 --- a/packages/coding-agent/src/task/index.ts +++ b/packages/coding-agent/src/task/index.ts @@ -700,7 +700,11 @@ export class TaskTool implements AgentTool { const status = r.aborted ? "cancelled" : r.exitCode === 0 ? "completed" : `failed (exit ${r.exitCode})`; const output = r.output.trim() || r.stderr.trim() || "(no output)"; - const preview = output.split("\n").slice(0, 5).join("\n"); + const outputLines = output.split("\n"); + const outputLineCount = r.outputMeta?.lineCount ?? outputLines.length; + const fullOutputThreshold = 30; + const previewLimit = outputLineCount <= fullOutputThreshold ? outputLines.length : 10; + const preview = outputLines.slice(0, previewLimit).join("\n"); const meta = r.outputMeta ? ` [${r.outputMeta.lineCount} lines, ${formatBytes(r.outputMeta.charCount)}]` : "";