You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Advanced base agent that orchestrates planning, editing, and reviewing for complex coding tasks',
@@ -48,15 +49,18 @@ export const createBase2: (
48
49
'write_file',
49
50
),
50
51
spawnableAgents: buildArray(
51
-
'file-researcher',
52
+
!isGpt5&&'file-researcher',
52
53
'file-picker-max',
53
54
'code-searcher',
54
55
'directory-lister',
55
56
'glob-matcher',
56
57
'researcher-web',
57
58
'researcher-docs',
58
59
'commander',
59
-
isFast&&'best-of-n-orchestrator-fast',
60
+
isFast&&
61
+
(isGpt5
62
+
? 'best-of-n-orchestrator-gpt-5'
63
+
: 'best-of-n-orchestrator-fast'),
60
64
isMax&&'base2-gpt-5-worker',
61
65
'context-pruner',
62
66
),
@@ -74,13 +78,14 @@ Continue to spawn layers of agents until have completed the user's request or re
74
78
## Spawning agents guidelines
75
79
76
80
- **Sequence agents properly:** Keep in mind dependencies when spawning different agents. Don't spawn agents in parallel that depend on each other. Be conservative sequencing agents so they can build on each other's insights:
77
-
- Spawn file pickers, code-searcher, directory-lister, glob-matcher, commanders, and researchersbefore making edits.
81
+
- Spawn ${isGpt5 ? 'file pickers, code-searcher, directory-lister, glob-matcher, commanders, and researchers' : 'the file researcher and optionally the web researcher and docs researcher'}before making edits.${isGpt5 ? '' : ' After that, spawn further agents to gather context as needed (e.g. the code-searcher, directory-lister, glob-matcher, commanders, and researchers).'}
78
82
${buildArray(
79
83
isFast&&
80
-
'- Spawn a best-of-n-orchestrator-fast agent to implement the changes after you have gathered all the context you need (and not before!).',
84
+
`- Spawn a ${isGpt5 ? 'best-of-n-orchestrator-gpt-5' : 'best-of-n-orchestrator-fast'} agent to implement the changes after you have gathered all the context you need (and not before!).`,
81
85
isMax&&
82
86
'- Spawn a base2-gpt-5-worker agent inline after you have gathered all the context you need (and not before!).',
83
87
).join('\n ')}
88
+
- **Spawn with the correct prompt and/or params:** Each agent has a schema for the input it expects. The prompt is an optional string, and the params is a json object. Note that some agents don't take any input prompt or params.
84
89
- **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.
The user asks you to implement a new feature. You respond in multiple steps:
144
149
145
150
${buildArray(
146
-
'- First, you must spawn a file-researcher to find relevant files; consider also spawning a web and/or docs researcher to find relevant information online. (Note: For the first layer, only spawn researchers, not other agents. Do not spawn a code-searcher yet!)',
147
-
'- Read **ALL** the files that the file-researcher found using the read_files tool. It is important that you read every single file that the file-researcher found. This is the only time you should use read_files on a long list of files -- it is expensive to do this more than once!',
148
-
`- Consider spawning other agents or reading more files as needed to gather comprehensive context to answer the user's request.`,
151
+
!isGpt5&&
152
+
'- First, for a new task, you must spawn a file-researcher to find relevant files; consider also spawning a web and/or docs researcher to find relevant information online. (Note: For the first layer, only spawn researchers, not other agents. Do not spawn a code-searcher yet!)',
153
+
!isGpt5&&
154
+
'- Read **ALL** the files that the file-researcher found using the read_files tool. It is important that you read every single file that the file-researcher found. This is the only time you should use read_files on a long list of files -- it is expensive to do this more than once!',
155
+
`- Consider spawning other agents or reading more files as needed to gather comprehensive context to answer the user's request. When in doubt, read more files!`,
156
+
isGpt5&&
157
+
`- Spawn file pickers, code-searcher, directory-lister, glob-matcher, commanders, and researchers to gather context as needed. Read all the relevant files using the read_files tool. Read as many files as possible so that you have a comprehensive context on the user's request.`,
149
158
isFast&&
150
159
`- Use the write_todos tool to write out your step-by-step implementation plan.${hasNoValidation ? '' : ' You should include at least one step to validate/test your changes: be specific about whether to typecheck, run tests, run lints, etc.'}`,
151
160
isFast&&
152
-
`- You must spawn the best-of-n-orchestrator-fast agent to implement the code changes, since it will generate the best code changes from multiple implementation proposals, which the user wants you to do.`,
161
+
`- You must spawn the ${isGpt5 ? 'best-of-n-orchestrator-gpt-5' : 'best-of-n-orchestrator-fast'} agent to implement the code changes, since it will generate the best code changes from multiple implementation proposals, which the user wants you to do.`,
153
162
isMax&&
154
163
`- IMPORTANT: You must spawn a base2-gpt-5-worker agent inline (with spawn_agent_inline tool) to do the planning and editing.`,
155
164
!hasNoValidation&&
156
165
`- Test your changes${isFast ? ' briefly' : ''} by running appropriate validation commands for the project (e.g. typechecks, tests, lints, etc.). You may have to explore the project to find the appropriate commands. Don't skip this step!`,
157
166
`- Inform the user that you have completed the task in one sentence or a few short bullet points. Don't create any markdown summary files or example documentation files, unless asked by the user. If you already finished the user request and said you're done, then don't say anything else.`,
158
167
).join('\n')}`,
159
-
stepPrompt: `${isMax ? "Keep working until the user's request is completely satisfied. " : ''}${isFast ? "You must spawn the best-of-n-orchestrator-fast agent to implement any code changes. Don't forget to do this! " : ''}After completing the user request, summarize your changes in a sentence or a few short bullet points. Do not create any summary markdown files or example documentation files, unless asked by the user. If you already summarized your changes, then end turn and don't say anything else.`,
168
+
stepPrompt: buildArray(
169
+
(isMax||isGpt5)&&
170
+
`Keep working until the user's request is completely satisfied${!hasNoValidation ? ' and validated' : ''}. `,
171
+
isFast&&
172
+
`You must spawn the ${isGpt5 ? 'best-of-n-orchestrator-gpt-5' : 'best-of-n-orchestrator-fast'} agent to implement any code changes. Don't forget to do this! `,
173
+
`After completing the user request, summarize your changes in a sentence or a few short bullet points. Do not create any summary markdown files or example documentation files, unless asked by the user. If you already summarized your changes, then end turn and don't say anything else.`,
174
+
isGpt5&&
175
+
`IMPORTANT: every response *must* include at least one tool call (using "<codebuff_tool_call>" tags), unless you are done with the task. If you don't include at least one tool call, your response will be cut off and the task will be ended prematurely, which is very bad for fulfilling the user's request. When completely done, you can respond without a tool call.`,
Copy file name to clipboardExpand all lines: .agents/base2/best-of-n/best-of-n-implementor.ts
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,10 @@ OR for new files or major rewrites:
60
60
"content": "Complete file content or edit snippet"
61
61
}
62
62
</codebuff_tool_call>
63
-
63
+
${
64
+
isGpt5
65
+
? ``
66
+
: `
64
67
You can also use <think> tags interspersed between tool calls to think about the best way to implement the changes. Keep these thoughts very brief. You may not need to use think tags at all.
65
68
66
69
<example>
@@ -85,7 +88,8 @@ You can also use <think> tags interspersed between tool calls to think about the
'Orchestrates multiple implementor agents to generate implementation proposals, selects the best one, and applies the changes (no need to make the edits yourself).',
0 commit comments