Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, test, expect } from 'bun:test'

import commander from '../commander'
import commander from '../basher'

import type { AgentState } from '../types/agent-definition'
import type { ToolResultOutput } from '../types/util-types'
Expand All @@ -19,11 +19,11 @@ describe('commander agent', () => {

describe('definition', () => {
test('has correct id', () => {
expect(commander.id).toBe('commander')
expect(commander.id).toBe('basher')
})

test('has display name', () => {
expect(commander.displayName).toBe('Commander')
expect(commander.displayName).toBe('Basher')
})

test('uses flash-lite model', () => {
Expand Down
6 changes: 3 additions & 3 deletions agents/base2/base-deep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Use the spawn_agents tool to spawn specialized agents to help you complete the u
- Spawn the thinker-gpt after gathering context to solve complex problems or when the user asks you to think about a problem. (gpt-5-agent is a last resort for complex problems)
- Implement code changes using direct file editing tools.
- Prefer apply_patch for existing-file edits. Use write_file only for creating or replacing entire files when that is simpler.
- Spawn commanders sequentially if the second command depends on the the first.
- Spawn bashers sequentially if the second command depends on the the first.
- **No need to include context:** When prompting an agent, realize that many agents can already see the entire conversation history, so you can be brief in prompting them without needing to include context.
- **Never spawn the context-pruner agent:** This agent is spawned automatically for you and you don't need to spawn it yourself.

Expand Down Expand Up @@ -199,7 +199,7 @@ Iteratively review until the code is clean:

Thoroughly validate the changes:

1. Run any existing unit tests that cover the modified code (spawn commanders in parallel for typechecks, tests, lints as appropriate).
1. Run any existing unit tests that cover the modified code (spawn bashers in parallel for typechecks, tests, lints as appropriate).
2. Write and run additional unit tests for new functionality. Fix any test failures.
3. You MUST attempt end-to-end verification: use tools to run the actual application (or equivalent) and verify the changes work in practice. For example:
- For a web app: start the server and check the relevant endpoints
Expand Down Expand Up @@ -298,7 +298,7 @@ export function createBaseDeep(options?: {
'glob-matcher',
'researcher-web',
'researcher-docs',
'commander',
'basher',
'thinker-gpt',
'code-reviewer-gpt',
'gpt-5-agent',
Expand Down
18 changes: 9 additions & 9 deletions agents/base2/base2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function createBase2(
isMax && 'file-picker-max',
'researcher-web',
'researcher-docs',
isFree ? 'commander-lite' : 'commander',
'basher',
isDefault && 'thinker',
(isDefault || isMax) && ['opus-agent', 'gpt-5-agent'],
isMax && 'thinker-best-of-n-opus',
Expand Down Expand Up @@ -125,7 +125,7 @@ export function createBase2(
- Create an impressive demonstration showcasing web development capabilities
- **Refactoring Awareness:** Whenever you modify an exported symbol like a function or class or variable, you should find and update all the references to it appropriately using the code_search tool.
- **Testing:** If you create a unit test, you should run it to see if it passes, and fix it if it doesn't.
- **Package Management:** When adding new packages, use the commander agent to install the package rather than editing the package.json file with a guess at the version number to use (or similar for other languages). This way, you will be sure to have the latest version of the package. Do not install packages globally unless asked by the user (e.g. Don't run \`npm install -g <package-name>\`). Always try to use the package manager associated with the project (e.g. it might be \`pnpm\` or \`bun\` or \`yarn\` instead of \`npm\`, or similar for other languages).
- **Package Management:** When adding new packages, use the basher agent to install the package rather than editing the package.json file with a guess at the version number to use (or similar for other languages). This way, you will be sure to have the latest version of the package. Do not install packages globally unless asked by the user (e.g. Don't run \`npm install -g <package-name>\`). Always try to use the package manager associated with the project (e.g. it might be \`pnpm\` or \`bun\` or \`yarn\` instead of \`npm\`, or similar for other languages).
- **Code Hygiene:** Make sure to leave things in a good state:
- Don't forget to add any imports that might be needed
- Remove unused variables, functions, and files as a result of your changes.
Expand All @@ -152,7 +152,7 @@ Use the spawn_agents tool to spawn specialized agents to help you complete the u
'- Implement code changes using the str_replace or write_file tools directly.',
isFree &&
'- Spawn a code-reviewer-lite to review the changes after you have implemented the changes.',
'- Spawn commanders sequentially if the second command depends on the the first.',
'- Spawn bashers sequentially if the second command depends on the the first.',
isDefault &&
'- Spawn a code-reviewer to review the changes after you have implemented the changes.',
isMax &&
Expand Down Expand Up @@ -213,12 +213,12 @@ ${isDefault
}

${isDefault
? `[ You spawn a code-reviewer, a commander to typecheck the changes, and another commander to run tests, all in parallel ]`
? `[ You spawn a code-reviewer, a basher to typecheck the changes, and another basher to run tests, all in parallel ]`
: isFree
? `[ You spawn a code-reviewer-lite to review the changes, and a commander to typecheck the changes, and another commander to run tests, all in parallel ]`
? `[ You spawn a code-reviewer-lite to review the changes, and a basher to typecheck the changes, and another basher to run tests, all in parallel ]`
: isMax
? `[ You spawn a commander to typecheck the changes, and another commander to run tests, in parallel. Then, you spawn a code-reviewer-multi-prompt to review the changes. ]`
: '[ You spawn a commander to typecheck the changes and another commander to run tests, all in parallel ]'
? `[ You spawn a basher to typecheck the changes, and another basher to run tests, in parallel. Then, you spawn a code-reviewer-multi-prompt to review the changes. ]`
: '[ You spawn a basher to typecheck the changes and another basher to run tests, all in parallel ]'
}

${isDefault
Expand All @@ -227,7 +227,7 @@ ${isDefault
? `[ You fix the issues found by the code-reviewer-lite and type/test errors ]`
: isMax
? `[ You fix the issues found by the code-reviewer-multi-prompt and type/test errors ]`
: '[ You fix the issues found by the type/test errors and spawn more commanders to confirm ]'
: '[ You fix the issues found by the type/test errors and spawn more bashers to confirm ]'
}

[ All tests & typechecks pass -- you write a very short final summary of the changes you made ]
Expand Down Expand Up @@ -298,7 +298,7 @@ ${PLACEHOLDER.GIT_CHANGES_PROMPT}
}
}

const EXPLORE_PROMPT = `- Iteratively spawn file pickers, commanders, and web/docs researchers to gather context as needed. Use the code_search, list_directory, and glob tools directly for searching and exploring the codebase. The file-picker agent in particular is very useful to find relevant files -- try spawning multiple in parallel (say, 2-5) to explore different parts of the codebase. Use read_subtree if you need to grok a particular part of the codebase. Read all the relevant files using the read_files tool.`
const EXPLORE_PROMPT = `- Iteratively spawn file pickers, bashers, and web/docs researchers to gather context as needed. Use the code_search, list_directory, and glob tools directly for searching and exploring the codebase. The file-picker agent in particular is very useful to find relevant files -- try spawning multiple in parallel (say, 2-5) to explore different parts of the codebase. Use read_subtree if you need to grok a particular part of the codebase. Read all the relevant files using the read_files tool.`

function buildImplementationInstructionsPrompt({
isSonnet,
Expand Down
12 changes: 6 additions & 6 deletions agents/commander.ts → agents/basher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import type {
AgentStepContext,
} from './types/agent-definition'

const commander: AgentDefinition = {
id: 'commander',
const basher: AgentDefinition = {
id: 'basher',
publisher,
model: 'google/gemini-3.1-flash-lite-preview',
displayName: 'Commander',
displayName: 'Basher',
spawnerPrompt:
'Runs a single terminal command and describes its output using an LLM based on what information is requested.',
'Runs a single terminal command and describes its output using an LLM. A lightweight shell command executor.',

inputSchema: {
prompt: {
Expand Down Expand Up @@ -64,7 +64,7 @@ Do not use any tools! Only analyze the output of the command.`,
const command = params?.command as string | undefined
if (!command) {
// Using console.error because agents run in a sandboxed environment without access to structured logger
console.error('Commander agent: missing required "command" parameter')
console.error('Basher agent: missing required "command" parameter')
yield {
toolName: 'set_output',
input: { output: 'Error: Missing required "command" parameter' },
Expand Down Expand Up @@ -102,4 +102,4 @@ Do not use any tools! Only analyze the output of the command.`,
},
}

export default commander
export default basher
12 changes: 0 additions & 12 deletions agents/commander-lite.ts

This file was deleted.

3 changes: 1 addition & 2 deletions agents/context-pruner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,7 @@ const definition: AgentDefinition = {
'file-picker',
'researcher-web',
'researcher-docs',
'commander',
'commander-lite',
'basher',
'code-reviewer',
'code-reviewer-multi-prompt',
]
Expand Down
4 changes: 2 additions & 2 deletions agents/general-agent/general-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const createGeneralAgent = (options: {
'code-searcher',
'directory-lister',
'glob-matcher',
'commander',
'basher',
'context-pruner',
),
toolNames: [
Expand All @@ -69,7 +69,7 @@ export const createGeneralAgent = (options: {

instructionsPrompt: buildArray(
`Use the spawn_agents tool to spawn agents to help you complete the user request.`,
!isGpt5 && `If you need to find more information in the codebase, file-picker is really good at finding relevant files. You should spawn multiple agents in parallel when possible to speed up the process. (e.g. spawn 3 file-pickers + 1 code-searcher + 1 researcher-web in one spawn_agents call or 3 commanders in one spawn_agents call).`,
!isGpt5 && `If you need to find more information in the codebase, file-picker is really good at finding relevant files. You should spawn multiple agents in parallel when possible to speed up the process. (e.g. spawn 3 file-pickers + 1 code-searcher + 1 researcher-web in one spawn_agents call or 3 bashers in one spawn_agents call).`,
).join('\n'),

handleSteps: function* ({ params }) {
Expand Down
Loading
Loading