Skip to content

Commit f393b3a

Browse files
committed
Raw output mode for commander
1 parent 6db432d commit f393b3a

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.agents/commander.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const commander: AgentDefinition = {
1010
model: 'anthropic/claude-haiku-4.5',
1111
displayName: 'Commander',
1212
spawnerPrompt:
13-
'Runs a single terminal command and describes its output based on what information is requested.',
13+
'Runs a single terminal command and describes its output using an LLM based on what information is requested.',
14+
1415
inputSchema: {
1516
prompt: {
1617
type: 'string',
@@ -28,6 +29,11 @@ const commander: AgentDefinition = {
2829
type: 'number',
2930
description: 'Set to -1 for no timeout. Default 30',
3031
},
32+
rawOutput: {
33+
type: 'boolean',
34+
description:
35+
'If true, returns the full command output without summarization. Defaults to false.',
36+
},
3137
},
3238
required: ['command'],
3339
},
@@ -60,16 +66,29 @@ Do not use any tools! Only analyze the output of the command.`,
6066
}
6167

6268
const timeout_seconds = params?.timeout_seconds as number | undefined
69+
const rawOutput = params?.rawOutput as boolean | undefined
6370

6471
// Run the command
65-
yield {
72+
const { toolResult } = yield {
6673
toolName: 'run_terminal_command',
6774
input: {
6875
command,
6976
...(timeout_seconds !== undefined && { timeout_seconds }),
7077
},
7178
}
7279

80+
if (rawOutput) {
81+
// Return the raw command output without summarization
82+
const result = toolResult?.[0]
83+
const output = result?.type === 'json' ? result.value : ''
84+
yield {
85+
toolName: 'set_output',
86+
input: { output },
87+
includeToolCall: false,
88+
}
89+
return
90+
}
91+
7392
// Let the model analyze and describe the output
7493
yield 'STEP'
7594
},

0 commit comments

Comments
 (0)