Skip to content

Commit 03a00ce

Browse files
committed
Let base2 invoke an agent to run read-only terminal commands
1 parent a2b0e38 commit 03a00ce

File tree

4 files changed

+48
-4
lines changed

4 files changed

+48
-4
lines changed

.agents/base2/base2-factory.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,14 @@ export const base2 = (model: ModelName): Omit<SecretAgentDefinition, 'id'> => ({
3030
outputMode: 'last_message',
3131
includeMessageHistory: true,
3232
toolNames: ['spawn_agent_inline', 'spawn_agents', 'add_message', 'end_turn'],
33-
spawnableAgents: ['scout', 'planner', 'editor', 'reviewer', 'context-pruner'],
33+
spawnableAgents: [
34+
'read-only-commander',
35+
'scout',
36+
'planner',
37+
'editor',
38+
'reviewer',
39+
'context-pruner',
40+
],
3441

3542
systemPrompt: `You are Buffy, a strategic coding assistant that orchestrates complex coding tasks through specialized sub-agents.
3643
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { publisher } from '../constants'
2+
import {
3+
PLACEHOLDER,
4+
type SecretAgentDefinition,
5+
} from '../types/secret-agent-definition'
6+
7+
const readOnlyCommander: SecretAgentDefinition = {
8+
id: 'read-only-commander',
9+
publisher,
10+
model: 'x-ai/grok-code-fast-1',
11+
reasoningOptions: {
12+
enabled: true,
13+
effort: 'low',
14+
exclude: true,
15+
},
16+
displayName: 'ReadOnly Commander',
17+
spawnerPrompt:
18+
'Can run quick read-only terminal commands and report back on the results. Has a basic understanding of the codebase.',
19+
inputSchema: {
20+
prompt: {
21+
type: 'string',
22+
description:
23+
'The question to answer about the codebase or with use of the terminal.',
24+
},
25+
},
26+
outputMode: 'last_message',
27+
includeMessageHistory: true,
28+
toolNames: ['run_terminal_command', 'code_search', 'read_files'],
29+
systemPrompt: `You are an expert software engineer, however you only execute READ ONLY commands to answer the user's question.
30+
31+
${PLACEHOLDER.FILE_TREE_PROMPT}
32+
${PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS}`,
33+
instructionsPrompt: `Use the tools to answer the user's question. But do not invoke any terminal commands that could have any permanent effects -- no editing files, no running scripts, no git commits, no installing packages, etc.`,
34+
}
35+
36+
export default readOnlyCommander

.agents/base2/scout.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const definition: SecretAgentDefinition = {
1010
model: 'openai/gpt-5-chat',
1111
displayName: 'Lewis & Clark',
1212
spawnableAgents: ['file-explorer', 'web-researcher', 'docs-researcher'],
13-
toolNames: ['spawn_agents', 'read_files', 'end_turn'],
13+
toolNames: ['spawn_agents', 'read_files', 'code_search', 'end_turn'],
1414

1515
inputSchema: {
1616
prompt: {
@@ -21,7 +21,7 @@ const definition: SecretAgentDefinition = {
2121
outputMode: 'last_message',
2222
includeMessageHistory: true,
2323

24-
spawnerPrompt: `Spawn this agent when you need a quick answer to a question. Can search the codebase and the web.`,
24+
spawnerPrompt: `Spawn this agent when you need a quick answer to a question. Can search the codebase and the web. Has a good understanding of the codebase.`,
2525
systemPrompt: `You are an expert architect and researcher. You are quick to search the codebase and web, but you only operate in a read-only capacity. (You should not offer to write code or make changes to the codebase.)
2626
2727
You spawn agents to help you gather information and answer the user's question. If you need to spawn multiple agents, it's good to spawn multiple agents in parallel to quickly answer the question.
@@ -30,7 +30,6 @@ Then answer the question to the best of your ability.
3030
3131
You cannot use any other tools beyond the ones provided to you. (No abiltity to read files, write files, or run terminal commands, etc.)
3232
33-
Note: when you spawn the file-explorer, it takes a params field, which is an object with a prompts field, which is an array of strings.
3433
Note: No need to spawn multiple file-explorer agents, but you can spawn multiple web-researcher or docs-researcher agents.
3534
3635
${PLACEHOLDER.FILE_TREE_PROMPT}
@@ -39,6 +38,7 @@ ${PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS}`,
3938
instructionsPrompt: `Instructions:
4039
In your thinking, consider which agent(s) to spawn.
4140
- Spawn the file-explorer, web-researcher, docs-researcher, or any combination of the above at the same time with the spawn_agents tool. Do not spawn any more agents after this step. You only get one spawn_agents tool call (which can include multiple agents). Don't narrate what prompts/params you will use for the agents, just use the tool to spawn them.
41+
- (Optional) Use the code_search or read_files tool to search the codebase for relevant information.
4242
- Answer the user question to the best of your ability from the information gathered from the agents focusing on the relevant information. Be concise. Never include any of the following in your response:
4343
- Irrelevant information.
4444
- A summary of the situation at the end.

common/src/templates/initial-agents-dir/types/agent-definition.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ export type ModelName =
324324

325325
// X-AI
326326
| 'x-ai/grok-4-07-09'
327+
| 'x-ai/grok-code-fast-1'
327328

328329
// Qwen
329330
| 'qwen/qwen3-coder'

0 commit comments

Comments
 (0)