Skip to content

Commit d1b6717

Browse files
committed
Update thinker & reviewer to use prompt-cached Sonnet
1 parent d521f19 commit d1b6717

File tree

8 files changed

+17
-62
lines changed

8 files changed

+17
-62
lines changed

.agents/base-max.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ const definition: SecretAgentDefinition = {
1111
'file-explorer',
1212
'researcher-web-sonnet',
1313
'researcher-docs-sonnet',
14-
'implementation-planner-max',
14+
'decomposing-planner',
1515
'thinker',
16-
'reviewer-max',
16+
'reviewer',
1717
'context-pruner',
1818
],
1919
}

.agents/prompts/base-prompts.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export const baseAgentUserInputPrompt = (
252252
`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.`,
253253

254254
isMax &&
255-
`IMPORTANT: You must spawn the implementation-planner-max agent for all non-trivial coding tasks. It will help you come up with the best possible code changes. This is non-negotiable. The user needs you to spawn this agent to get the best possible code changes. Use your judgment to deviate from the plan whereever you see fit.`,
255+
`IMPORTANT: You must spawn the decomposing-planner agent for all non-trivial coding tasks. It will help you come up with the best possible code changes. This is non-negotiable. The user needs you to spawn this agent to get the best possible code changes. Use your judgment to deviate from the plan whereever you see fit.`,
256256

257257
'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.',
258258

@@ -308,7 +308,7 @@ export const baseAgentUserInputPrompt = (
308308
`You must use the spawn_agents tool to spawn agents to help you complete the user request. You can spawn as many agents as you want. It is a good idea to spawn a file explorer agent first to explore the codebase. ${isLite ? '' : 'Finally, you must spawn the reviewer agent to review your code changes.'}`,
309309

310310
isMax &&
311-
`IMPORTANT: You must spawn the implementation-planner-max agent for all non-trivial coding tasks. It will help you come up with the best possible code changes. This is non-negotiable. The user needs you to spawn this agent to get the best possible code changes. Use your judgment to deviate from the plan whereever you see fit.`,
311+
`IMPORTANT: You must spawn the decomposing-planner agent for all non-trivial coding tasks. It will help you come up with the best possible code changes. This is non-negotiable. The user needs you to spawn this agent to get the best possible code changes. Use your judgment to deviate from the plan whereever you see fit.`,
312312

313313
!isGPT5 &&
314314
'Finally, you must use the end_turn tool at the end of your response when you have completed the user request or want the user to respond to your message.',
@@ -330,11 +330,8 @@ If you don't do this, then your response will be cut off and the turn will be en
330330
}
331331

332332
export const baseAgentAgentStepPrompt = (model: Model) => {
333-
return `<system>
334-
You have ${PLACEHOLDER.REMAINING_STEPS} more response(s) before you will be cut off and the turn will be ended automatically.
333+
return `You have ${PLACEHOLDER.REMAINING_STEPS} more response(s) before you will be cut off and the turn will be ended automatically.
335334
336335
Assistant cwd (project root): ${PLACEHOLDER.PROJECT_ROOT}
337-
User cwd: ${PLACEHOLDER.USER_CWD}
338-
${closeXml('system')}
339-
`
336+
User cwd: ${PLACEHOLDER.USER_CWD}`
340337
}

.agents/reviewer/reviewer-factory.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { AGENT_PERSONAS } from '@codebuff/common/constants/agents'
21
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
32
import type { Model } from '@codebuff/common/old-constants'
43

54
export const reviewer = (model: Model): Omit<SecretAgentDefinition, 'id'> => ({
65
model,
7-
displayName: AGENT_PERSONAS.reviewer.displayName,
8-
spawnerPrompt: AGENT_PERSONAS.reviewer.purpose,
6+
displayName: 'Nit Pick Nick',
7+
spawnerPrompt:
8+
'Reviews file changes and responds with critical feedback. Use this after making any significant change to the codebase; otherwise, no need to use this agent for minor changes since it takes a second.',
99
inputSchema: {
1010
prompt: {
1111
type: 'string',

.agents/reviewer/reviewer.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ import type { SecretAgentDefinition } from '../types/secret-agent-definition'
66
const definition: SecretAgentDefinition = {
77
id: 'reviewer',
88
publisher,
9-
...reviewer('google/gemini-2.5-pro'),
10-
reasoningOptions: {
11-
effort: 'low',
12-
exclude: true,
13-
},
9+
...reviewer('anthropic/claude-sonnet-4.5'),
1410
}
1511

1612
export default definition

.agents/thinker/decomposing-thinker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const definition: SecretAgentDefinition = {
88
model: 'anthropic/claude-sonnet-4.5',
99
displayName: 'Decomposing Thinker',
1010
spawnerPrompt:
11-
'Creates comprehensive analysis by decomposing problems into multiple thinking angles and synthesizing insights from parallel thinker-sonnet agents.',
11+
'Creates comprehensive analysis by decomposing problems into multiple thinking angles and synthesizing insights from parallel thinker agents.',
1212
inputSchema: {
1313
params: {
1414
type: 'object',
@@ -19,7 +19,7 @@ const definition: SecretAgentDefinition = {
1919
type: 'string',
2020
description: 'A specific problem or topic to analyze',
2121
},
22-
description: 'A list of 2-10 specific problems or topics to analyze',
22+
description: 'A list of 2-8 specific problems or topics to analyze',
2323
},
2424
},
2525
required: ['prompts'],
@@ -29,15 +29,15 @@ const definition: SecretAgentDefinition = {
2929
includeMessageHistory: true,
3030
outputMode: 'structured_output',
3131
toolNames: ['spawn_agents', 'set_output'],
32-
spawnableAgents: ['thinker-sonnet'],
32+
spawnableAgents: ['thinker'],
3333

3434
handleSteps: function* ({ params }) {
3535
const prompts: string[] = params?.prompts ?? []
3636
const { toolResult } = yield {
3737
toolName: 'spawn_agents',
3838
input: {
3939
agents: prompts.map((promptText) => ({
40-
agent_type: 'thinker-sonnet',
40+
agent_type: 'thinker',
4141
prompt: promptText,
4242
})),
4343
},

.agents/thinker/thinker-sonnet.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

.agents/thinker/thinker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { SecretAgentDefinition } from '../types/secret-agent-definition'
55
const definition: SecretAgentDefinition = {
66
id: 'thinker',
77
publisher,
8-
model: 'openai/gpt-5',
8+
model: 'anthropic/claude-sonnet-4.5',
99
displayName: 'Theo the Theorizer',
1010
spawnerPrompt:
1111
'Does deep thinking given the current messages and a specific prompt to focus on. Use this to help you solve a specific problem.',

backend/src/templates/strings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ export async function getAgentPrompt<T extends StringField>({
175175
let addendum = ''
176176

177177
if (promptType.type === 'stepPrompt' && agentState.agentType) {
178-
// Put step prompt within a system-reminder tag so agent doesn't think the user just spoke again.
179-
prompt = `<system-reminder>${prompt}</system-reminder>`
178+
// Put step prompt within a system_reminder tag so agent doesn't think the user just spoke again.
179+
prompt = `<system_reminder>${prompt}</system_reminder>`
180180
}
181181

182182
// Add tool instructions, spawnable agents, and output schema prompts to instructionsPrompt

0 commit comments

Comments
 (0)