Skip to content

Commit 5cb4e7b

Browse files
committed
Add thinker-gpt-5 agent!
1 parent 82cf4d3 commit 5cb4e7b

File tree

2 files changed

+55
-3
lines changed

2 files changed

+55
-3
lines changed

agents/base2/base2.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ export function createBase2(
7474
'researcher-docs',
7575
isLite ? 'commander-lite' : 'commander',
7676
isDefault && 'thinker',
77+
(isDefault || isMax) && 'thinker-gpt-5',
78+
isMax && 'thinker-best-of-n-opus',
7779
isLite && 'editor-gpt-5',
7880
isDefault && 'editor',
7981
isMax && 'editor-multi-prompt',
80-
isMax && 'thinker-best-of-n-opus',
8182
isDefault && 'code-reviewer',
8283
isMax && 'code-reviewer-multi-prompt',
8384
'context-pruner',
@@ -138,7 +139,7 @@ Use the spawn_agents tool to spawn specialized agents to help you complete the u
138139
isDefault &&
139140
'- Spawn the editor agent to implement the changes after you have gathered all the context you need.',
140141
(isDefault || isMax) &&
141-
`- Spawn the ${isDefault ? 'thinker' : 'thinker-best-of-n-opus'} after gathering context to solve complex problems or when the user asks you to think about a problem.`,
142+
`- Spawn the ${isDefault ? 'thinker' : 'thinker-best-of-n-opus'} after gathering context to solve complex problems or when the user asks you to think about a problem. (thinker-gpt-5 is a last resort for complex problems)`,
142143
isMax &&
143144
`- IMPORTANT: You must spawn the editor-multi-prompt agent to implement the changes after you have gathered all the context you need. You must spawn this agent for non-trivial changes, since it writes much better code than you would with the str_replace or write_file tools. Don't spawn the editor in parallel with context-gathering agents.`,
144145
'- Spawn commanders sequentially if the second command depends on the the first.',
@@ -323,7 +324,7 @@ ${buildArray(
323324
(isDefault || isMax) &&
324325
`- For any task requiring 3+ steps, use the write_todos tool to write out your step-by-step implementation plan. Include ALL of the applicable tasks in the list.${isFast ? '' : ' You should include a step to review the changes after you have implemented the changes.'}:${hasNoValidation ? '' : ' You should include at least one step to validate/test your changes: be specific about whether to typecheck, run tests, run lints, etc.'} You may be able to do reviewing and validation in parallel in the same step. Skip write_todos for simple tasks like quick edits or answering questions.`,
325326
(isDefault || isMax) &&
326-
`- For quick problems, briefly explain your reasoning to the user. If you need to think longer, write your thoughts within the <think> tags. Finally, for complex problems, spawn the thinker agent to help find the best solution.`,
327+
`- For quick problems, briefly explain your reasoning to the user. If you need to think longer, write your thoughts within the <think> tags. Finally, for complex problems, spawn the thinker agent to help find the best solution. (thinker-gpt-5 is a last resort for complex problems)`,
327328
isLite &&
328329
'- IMPORTANT: You must spawn the editor-gpt-5 agent to implement the changes after you have gathered all the context you need. This agent will do the best job of implementing the changes so you must spawn it for all changes. Do not pass any prompt or params to the editor agent when spawning it. It will make its own best choices of what to do.',
329330
isDefault &&

agents/thinker/thinker-gpt-5.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { publisher } from '../constants'
2+
3+
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
4+
5+
const definition: SecretAgentDefinition = {
6+
id: 'thinker-gpt-5',
7+
publisher,
8+
model: 'openai/gpt-5.2',
9+
displayName: 'GPT-5 Thinker',
10+
spawnerPrompt:
11+
'Does deep thinking given the prompt and optionally provided files. Use this to help you solve a specific problem that requires extended reasoning.',
12+
inputSchema: {
13+
prompt: {
14+
type: 'string',
15+
description: 'The problem you are trying to solve',
16+
},
17+
params: {
18+
type: 'object',
19+
properties: {
20+
filePaths: {
21+
type: 'array',
22+
items: {
23+
type: 'string',
24+
description: 'The path to a file',
25+
},
26+
description:
27+
'An optional list of relevant file paths to read before thinking. Try to provide as many as possible that could be relevant to your request.',
28+
},
29+
},
30+
},
31+
},
32+
outputMode: 'last_message',
33+
spawnableAgents: ['researcher-web', 'researcher-docs', 'file-picker', 'code-searcher', 'directory-lister', 'glob-matcher', 'commander'],
34+
toolNames: ['spawn_agents', 'read_files'],
35+
36+
handleSteps: function* ({ params }) {
37+
const filePaths = params?.filePaths as string[] | undefined
38+
39+
if (filePaths && filePaths.length > 0) {
40+
yield {
41+
toolName: 'read_files',
42+
input: { paths: filePaths },
43+
}
44+
}
45+
46+
// Allow multiple steps for extended reasoning
47+
yield 'STEP_ALL'
48+
},
49+
}
50+
51+
export default definition

0 commit comments

Comments
 (0)