feat(coding-agent): added tools list to system prompt and improved output preview logic
- Added available tools list to system prompt for agent coherence. - Improved output preview logic to show full output for smaller results and truncate larger outputs to 10 lines.
This commit is contained in:
@@ -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**
|
||||
|
||||
@@ -700,7 +700,11 @@ export class TaskTool implements AgentTool<typeof taskSchema, TaskToolDetails, T
|
||||
const summaries = results.map(r => {
|
||||
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)}]`
|
||||
: "";
|
||||
|
||||
Reference in New Issue
Block a user