Skip to content

Commit 533da58

Browse files
committed
Add best of n to fast mode. remove separate agents
1 parent c26496b commit 533da58

File tree

3 files changed

+8
-41
lines changed

3 files changed

+8
-41
lines changed

.agents/base2/base2.ts

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,9 @@ export const createBase2: (
1010
mode: 'fast' | 'max',
1111
options?: {
1212
hasNoValidation?: boolean
13-
bestOfN?: boolean
14-
bestOfNFast?: boolean
1513
},
1614
) => Omit<SecretAgentDefinition, 'id'> = (mode, options) => {
17-
const {
18-
hasNoValidation = false,
19-
bestOfN = false,
20-
bestOfNFast = false,
21-
} = options ?? {}
15+
const { hasNoValidation = false } = options ?? {}
2216
const isFast = mode === 'fast'
2317
const isMax = mode === 'max'
2418

@@ -62,8 +56,7 @@ export const createBase2: (
6256
'researcher-web',
6357
'researcher-docs',
6458
'commander',
65-
bestOfN && 'best-of-n-orchestrator',
66-
bestOfNFast && 'best-of-n-orchestrator-fast',
59+
isFast && 'best-of-n-orchestrator-fast',
6760
isMax && 'base2-gpt-5-worker',
6861
'context-pruner',
6962
),
@@ -83,6 +76,8 @@ Continue to spawn layers of agents until have completed the user's request or re
8376
- **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:
8477
- Spawn file pickers, code-searcher, directory-lister, glob-matcher, commanders, and researchers before making edits.
8578
${buildArray(
79+
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!).',
8681
isMax &&
8782
'- Spawn a base2-gpt-5-worker agent inline after you have gathered all the context you need (and not before!).',
8883
).join('\n ')}
@@ -153,21 +148,15 @@ ${buildArray(
153148
`- Consider spawning other agents or reading more files as needed to gather comprehensive context to answer the user's request.`,
154149
isFast &&
155150
`- 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.'}`,
156-
bestOfN &&
157-
`- You must spawn the best-of-n-orchestrator agent to implement the code changes, since it will generate multiple implementation proposals and select the best one, which the user wants you to do.`,
158-
bestOfNFast &&
159-
`- You must spawn the best-of-n-orchestrator-fast agent to implement the code changes, since it will generate multiple implementation proposals and select the best one, which the user wants you to do.`,
160-
!bestOfN &&
161-
!bestOfNFast &&
162-
isFast &&
163-
`- Use the str_replace or write_file tool to make the changes. (Pause after making all the changes to see the tool results of your edits and double check they went through correctly.)`,
151+
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.`,
164153
isMax &&
165154
`- IMPORTANT: You must spawn a base2-gpt-5-worker agent inline (with spawn_agent_inline tool) to do the planning and editing.`,
166155
!hasNoValidation &&
167156
`- 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!`,
168-
`- 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, unless asked by the user. If you already finished the user request and said you're done, then don't say anything else.`,
157+
`- 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.`,
169158
).join('\n')}`,
170-
stepPrompt: `${isMax ? "Keep working until the user's request is completely satisfied. " : ''}${bestOfN ? "You must spawn the best-of-n-orchestrator agent to implement the 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.`,
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.`,
171160
handleSteps: function* ({ params }) {
172161
let steps = 0
173162
while (true) {

.agents/base2/best-of-n/base2-best-of-n-fast.ts

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

.agents/base2/best-of-n/base2-best-of-n.ts

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

0 commit comments

Comments
 (0)