Skip to content

Commit e01273b

Browse files
committed
base-max overhaul
1 parent c25dba8 commit e01273b

15 files changed

+348
-17
lines changed

.agents/base-max.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ import type { SecretAgentDefinition } from './types/secret-agent-definition'
66
const definition: SecretAgentDefinition = {
77
id: 'base-max',
88
publisher,
9-
...base('anthropic/claude-opus-4.1', 'max'),
9+
...base('anthropic/claude-sonnet-4', 'max'),
10+
spawnableAgents: [
11+
'file-explorer',
12+
'researcher-web-gpt-5',
13+
'researcher-docs-gpt-5',
14+
'implementation-planner-max',
15+
'thinker',
16+
'reviewer-max',
17+
'context-pruner',
18+
],
1019
}
1120

1221
export default definition

.agents/base2/gpt-5-high/reviewer-gpt-5-high.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { reviewer } from '../../factory/reviewer'
1+
import { reviewer } from '../../reviewer/reviewer-factory'
22

33
import type { SecretAgentDefinition } from '../../types/secret-agent-definition'
44

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import { publisher } from '../constants'
2+
import { type SecretAgentDefinition } from '../types/secret-agent-definition'
3+
4+
const definition: SecretAgentDefinition = {
5+
id: 'implementation-planner-max',
6+
publisher,
7+
model: 'openai/gpt-5',
8+
displayName: 'Implementation Planner Max',
9+
spawnerPrompt:
10+
'Creates the best possible implementation plan by generating 3 different plans in parallel and selecting the optimal one. Includes full code changes.',
11+
inputSchema: {
12+
prompt: {
13+
type: 'string',
14+
description:
15+
'The task to plan for. Include the requirements and expected behavior after implementing the plan. Include quotes from the user of what they expect the plan to accomplish.',
16+
},
17+
},
18+
outputMode: 'structured_output',
19+
includeMessageHistory: true,
20+
toolNames: ['spawn_agents', 'set_output'],
21+
spawnableAgents: ['implementation-planner', 'plan-selector'],
22+
handleSteps: function* ({ prompt }) {
23+
// Step 1: Spawn 3 planners in parallel.
24+
const agents = Array.from({ length: 3 }, () => ({
25+
agent_type: 'implementation-planner',
26+
prompt,
27+
}))
28+
const { toolResult: plannerResults } = yield {
29+
toolName: 'spawn_agents',
30+
input: {
31+
agents,
32+
},
33+
}
34+
35+
if (!Array.isArray(plannerResults)) {
36+
yield {
37+
toolName: 'set_output',
38+
input: { error: 'Failed to generate plans.' },
39+
}
40+
return
41+
}
42+
const plannerResult = plannerResults[0]
43+
const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
44+
const plans =
45+
plannerResult.type === 'json' ? (plannerResult.value as any[]) : []
46+
const plansWithIds = plans.map((plan, index) => ({
47+
id: letters[index],
48+
plan: JSON.stringify(plan),
49+
}))
50+
51+
// Step 2: Spawn plan selector to choose the best plan
52+
const { toolResult: selectedPlanResult } = yield {
53+
toolName: 'spawn_agents',
54+
input: {
55+
agents: [
56+
{
57+
agent_type: 'plan-selector',
58+
prompt: `Choose the best plan from these options for the task: ${prompt}`,
59+
params: {
60+
plans: plansWithIds,
61+
},
62+
},
63+
],
64+
},
65+
}
66+
67+
if (!Array.isArray(selectedPlanResult) || selectedPlanResult.length < 1) {
68+
yield {
69+
toolName: 'set_output',
70+
input: { error: 'Failed to select a plan.' },
71+
}
72+
return
73+
}
74+
const selectedPlan = selectedPlanResult[0]
75+
const selectedPlanId =
76+
selectedPlan.type === 'json' && selectedPlan.value
77+
? (selectedPlan.value as { selectedPlanId: string }).selectedPlanId
78+
: null
79+
const selectedPlanWithId = plansWithIds.find(
80+
(plan) => plan.id === selectedPlanId,
81+
)
82+
83+
// Step 3: Set the selected plan as output
84+
yield {
85+
toolName: 'set_output',
86+
input: {
87+
plan: selectedPlanWithId?.plan ?? plans[0],
88+
},
89+
}
90+
},
91+
}
92+
93+
export default definition
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { publisher } from '../constants'
2+
import {
3+
PLACEHOLDER,
4+
type SecretAgentDefinition,
5+
} from '../types/secret-agent-definition'
6+
7+
const definition: SecretAgentDefinition = {
8+
id: 'implementation-planner',
9+
displayName: 'Implementation Planner',
10+
publisher,
11+
model: 'openai/gpt-5',
12+
reasoningOptions: {
13+
effort: 'medium',
14+
},
15+
spawnerPrompt:
16+
'Creates comprehensive implementation plans with full code changes by exploring the codebase, doing research on the web, and thinking deeply. You can also use it get a deep answer to any question. Use this agent for tasks that require thinking.',
17+
inputSchema: {
18+
prompt: {
19+
type: 'string',
20+
description:
21+
'The task to plan for. Include the requirements and expected behavior after implementing the plan. Include quotes from the user of what they expect the plan to accomplish.',
22+
},
23+
},
24+
outputMode: 'last_message',
25+
includeMessageHistory: true,
26+
toolNames: ['spawn_agents', 'read_files', 'end_turn'],
27+
spawnableAgents: [
28+
'file-explorer',
29+
'web-researcher',
30+
'docs-researcher',
31+
'thinker-gpt-5-high',
32+
],
33+
34+
systemPrompt: `You are an expert programmer, architect, researcher, and general problem solver.
35+
You spawn agents to help you gather information, and then describe a full change to the codebase that will accomplish the task.
36+
37+
${PLACEHOLDER.FILE_TREE_PROMPT}
38+
${PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS}`,
39+
40+
instructionsPrompt: `Instructions:
41+
- Spawn file-explorer twice to find all the relevant parts of the codebase. Use different prompts for each file-explorer to ensure you get all the relevant parts of the codebase. In parallel as part of the same spawn_agents tool call, you may also spawn a web-researcher or docs-researcher to search the web or technical documentation for relevant information.
42+
- Read all the file paths that are relevant using the read_files tool.
43+
- Read more and more files to get any information that could possibly help you make the best plan. It's good to read 20+ files.
44+
- Think about the best way to accomplish the task.
45+
- Finally, describe the full change to the codebase that will accomplish the task (or other steps, e.g. terminal commands to run). Use markdown code blocks to describe the changes for each file.
46+
- Then use the end_turn tool immediately after describing all the changes.
47+
48+
Important: You must use at least one tool call in every response unless you are done.
49+
For example, if you write something like:
50+
"I'll verify and finish the requested type updates by inspecting the current files and making any remaining edits."
51+
Then you must also include a tool call, e.g.:
52+
"I'll verify and finish the requested type updates by inspecting the current files and making any remaining edits. [insert read_files tool call]"
53+
If you don't do this, then your response will be cut off and the turn will be ended automatically.
54+
`,
55+
}
56+
57+
export default definition
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import { publisher } from '../constants'
2+
import {
3+
PLACEHOLDER,
4+
type SecretAgentDefinition,
5+
} from '../types/secret-agent-definition'
6+
7+
const definition: SecretAgentDefinition = {
8+
id: 'plan-selector',
9+
publisher,
10+
model: 'openai/gpt-5',
11+
reasoningOptions: {
12+
enabled: true,
13+
effort: 'low',
14+
},
15+
displayName: 'Plan Selector',
16+
spawnerPrompt:
17+
'Expert at evaluating and selecting the best plan from multiple options based on quality, feasibility, and simplicity.',
18+
toolNames: ['read_files', 'set_output'],
19+
spawnableAgents: [],
20+
inputSchema: {
21+
prompt: {
22+
type: 'string',
23+
description: 'The original task that was planned for',
24+
},
25+
params: {
26+
type: 'object',
27+
properties: {
28+
plans: {
29+
type: 'array',
30+
items: {
31+
type: 'object',
32+
properties: {
33+
id: { type: 'string' },
34+
plan: { type: 'string' },
35+
},
36+
required: ['id', 'plan'],
37+
},
38+
},
39+
},
40+
},
41+
},
42+
outputMode: 'structured_output',
43+
outputSchema: {
44+
type: 'object',
45+
properties: {
46+
reasoning: {
47+
type: 'string',
48+
description:
49+
"Thoughts on each plan and what's better or worse about each plan, leading up to which plan is the best choice.",
50+
},
51+
selectedPlanId: {
52+
type: 'string',
53+
description: 'The ID of the chosen plan.',
54+
},
55+
},
56+
required: ['reasoning', 'selectedPlanId'],
57+
},
58+
includeMessageHistory: false,
59+
systemPrompt: `You are an expert plan evaluator with deep experience in software engineering, architecture, and project management.
60+
61+
Your task is to analyze multiple plans and select the best one based on:
62+
1. **Feasibility** - How realistic and achievable is the plan?
63+
2. **Quality** - How well does it address the requirements?
64+
3. **Efficiency** - How minimal and focused are the changes?
65+
4. **Maintainability** - How well will this approach work long-term?
66+
5. **Risk** - What are the potential downsides or failure points?
67+
68+
${PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS}`,
69+
70+
instructionsPrompt: `Analyze all the provided plans and select the best one.
71+
72+
For each plan, evaluate:
73+
- Strengths and weaknesses
74+
- Implementation complexity
75+
- Alignment with the original task
76+
- Potential risks or issues
77+
78+
Use the set_output tool to return your selection.`,
79+
}
80+
81+
export default definition

.agents/prompts/base-prompts.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ export const baseAgentUserInputPrompt = (
236236
const isGPT5 =
237237
model === models.openrouter_gpt5 || model === models.openrouter_gpt5_chat
238238
const isLite = mode === 'lite'
239+
const isMax = mode === 'max'
239240

240241
return (
241242
PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS +
@@ -252,6 +253,9 @@ export const baseAgentUserInputPrompt = (
252253
'Important: You must spawn a file-explorer agent first to explore the codebase from different perspectives for non-trivial requests. This is an inexpensive way to get a lot of context on the codebase.',
253254
`Important: you *must* read as many files with the read_files tool as possible from the results of the file picker agents. Don't be afraid to read ${isLite ? '8' : '20'} files. The more files you read, the better context you have on the codebase and the better your response will be.`,
254255

256+
isMax &&
257+
`You must spawn the implementation-planner-max agent for medium to hard coding tasks. It will help you write the best possible code changes.`,
258+
255259
'If the users uses "@agent-id" or "@AgentName" in their message, you must spawn that agent. If you don\'t know what input parameters that agent expects, use the lookup_agent_info tool to get the agent metadata. Spawn all the agents that the user mentions.',
256260

257261
!isGPT5 &&
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { SecretAgentDefinition } from '../../types/secret-agent-definition'
2+
import { publisher } from '../../constants'
3+
import researcherCodebaseExplorer from '../researcher-codebase-explorer'
4+
5+
const definition: SecretAgentDefinition = {
6+
...researcherCodebaseExplorer,
7+
id: 'researcher-codebase-explorer-gpt-5',
8+
publisher,
9+
displayName: 'Codebase Explorer GPT-5',
10+
model: 'openai/gpt-5',
11+
reasoningOptions: {
12+
enabled: true,
13+
effort: 'medium',
14+
},
15+
}
16+
17+
export default definition
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { SecretAgentDefinition } from '../../types/secret-agent-definition'
2+
import { publisher } from '../../constants'
3+
import researcherDocs from '../researcher-docs'
4+
5+
const definition: SecretAgentDefinition = {
6+
...researcherDocs,
7+
id: 'researcher-docs-gpt-5',
8+
publisher,
9+
displayName: 'Docs Researcher GPT-5',
10+
model: 'openai/gpt-5',
11+
reasoningOptions: {
12+
effort: 'medium',
13+
},
14+
}
15+
16+
export default definition
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { type SecretAgentDefinition } from '../../types/secret-agent-definition'
2+
import { publisher } from '../../constants'
3+
import researcher from '../researcher-grok-4-fast'
4+
5+
const definition: SecretAgentDefinition = {
6+
...researcher,
7+
id: 'researcher-gpt-5',
8+
publisher,
9+
displayName: 'Researcher GPT-5',
10+
model: 'openai/gpt-5',
11+
reasoningOptions: {
12+
enabled: true,
13+
effort: 'medium',
14+
},
15+
16+
spawnableAgents: [
17+
'file-explorer',
18+
'researcher-codebase-explorer-gpt-5',
19+
'researcher-web-gpt-5',
20+
'researcher-docs-gpt-5',
21+
],
22+
}
23+
24+
export default definition
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { SecretAgentDefinition } from '../../types/secret-agent-definition'
2+
import { publisher } from '../../constants'
3+
import researcherWeb from '../researcher-web'
4+
5+
const definition: SecretAgentDefinition = {
6+
...researcherWeb,
7+
id: 'researcher-web-gpt-5',
8+
publisher,
9+
displayName: 'Web Researcher GPT-5',
10+
model: 'openai/gpt-5',
11+
reasoningOptions: {
12+
effort: 'medium',
13+
},
14+
}
15+
16+
export default definition

0 commit comments

Comments
 (0)