Skip to content

Commit 012f17d

Browse files
committed
base2-max-evals which doesn't use the ask_user / suggest followups tools
1 parent af437b7 commit 012f17d

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

.agents/base2/base2-max-evals.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { createBase2 } from './base2'
2+
3+
const definition = {
4+
...createBase2('max', { noAskUser: true }),
5+
id: 'base2-max-evals',
6+
displayName: 'Buffy the Max Evals Orchestrator',
7+
}
8+
export default definition

.agents/base2/base2.ts

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ export function createBase2(
1111
options?: {
1212
hasNoValidation?: boolean
1313
planOnly?: boolean
14+
noAskUser?: boolean
1415
},
1516
): Omit<SecretAgentDefinition, 'id'> {
16-
const { hasNoValidation = mode === 'fast', planOnly = false } = options ?? {}
17+
const {
18+
hasNoValidation = mode === 'fast',
19+
planOnly = false,
20+
noAskUser = false,
21+
} = options ?? {}
1722
const isDefault = mode === 'default'
1823
const isFast = mode === 'fast'
1924
const isMax = mode === 'max'
@@ -51,12 +56,12 @@ export function createBase2(
5156
'read_files',
5257
'read_subtree',
5358
!isFast && !isLite && 'write_todos',
54-
!isFast && 'suggest_followups',
59+
!isFast && !noAskUser && 'suggest_followups',
5560
'str_replace',
5661
'write_file',
5762
'propose_str_replace',
5863
'propose_write_file',
59-
'ask_user',
64+
!noAskUser && 'ask_user',
6065
'set_output',
6166
),
6267
spawnableAgents: buildArray(
@@ -86,8 +91,12 @@ export function createBase2(
8691
- **Spawn mentioned agents:** If the user uses "@AgentName" in their message, you must spawn that agent.
8792
- **Validate assumptions:** Use researchers, file pickers, and the read_files tool to verify assumptions about libraries and APIs before implementing.
8893
- **Proactiveness:** Fulfill the user's request thoroughly, including reasonable, directly implied follow-up actions.
89-
- **Confirm Ambiguity/Expansion:** Do not take significant actions beyond the clear scope of the request without confirming with the user. If asked *how* to do something, explain first, don't just do it.
90-
- **Ask the user about important decisions or guidance using the ask_user tool:** You should feel free to stop and ask the user for guidance if there's a an important decision to make or you need an important clarification or you're stuck and don't know what to try next. Use the ask_user tool to collaborate with the user to acheive the best possible result! Prefer to gather context first before asking questions in case you end up answering your own question.
94+
- **Confirm Ambiguity/Expansion:** Do not take significant actions beyond the clear scope of the request without confirming with the user. If asked *how* to do something, explain first, don't just do it.${
95+
noAskUser
96+
? ''
97+
: `
98+
- **Ask the user about important decisions or guidance using the ask_user tool:** You should feel free to stop and ask the user for guidance if there's a an important decision to make or you need an important clarification or you're stuck and don't know what to try next. Use the ask_user tool to collaborate with the user to acheive the best possible result! Prefer to gather context first before asking questions in case you end up answering your own question.`
99+
}
91100
- **Be careful about terminal commands:** Be careful about instructing subagents to run terminal commands that could be destructive or have effects that are hard to undo (e.g. git push, git commit, running any scripts -- especially ones that could alter production environments (!), installing packages globally, etc). Don't run any of these effectful commands unless the user explicitly asks you to.
92101
- **Do what the user asks:** If the user asks you to do something, even running a risky terminal command, do it.
93102
@@ -233,6 +242,7 @@ ${PLACEHOLDER.GIT_CHANGES_PROMPT}
233242
isMax,
234243
isLite,
235244
hasNoValidation,
245+
noAskUser,
236246
}),
237247
stepPrompt: planOnly
238248
? buildPlanOnlyStepPrompt({})
@@ -243,6 +253,7 @@ ${PLACEHOLDER.GIT_CHANGES_PROMPT}
243253
hasNoValidation,
244254
isSonnet,
245255
isLite,
256+
noAskUser,
246257
}),
247258

248259
handleSteps: function* ({ params }) {
@@ -275,13 +286,15 @@ function buildImplementationInstructionsPrompt({
275286
isMax,
276287
isLite,
277288
hasNoValidation,
289+
noAskUser,
278290
}: {
279291
isSonnet: boolean
280292
isFast: boolean
281293
isDefault: boolean
282294
isMax: boolean
283295
isLite: boolean
284296
hasNoValidation: boolean
297+
noAskUser: boolean
285298
}) {
286299
return `Act as a helpful assistant and freely respond to the user's request however would be most helpful to the user. Use your judgement to orchestrate the completion of the user's request using your specialized sub-agents and tools as needed. Take your time and be comprehensive. Don't surprise the user. For example, don't modify files if the user has not asked you to do so at least implicitly.
287300
@@ -293,7 +306,8 @@ ${buildArray(
293306
EXPLORE_PROMPT,
294307
isMax &&
295308
`- Important: Read as many files as could possibly be relevant to the task over several steps to improve your understanding of the user's request and produce the best possible code changes. Find more examples within the codebase similar to the user's request, dependencies that help with understanding how things work, tests, etc. This is frequently 12-20 files, depending on the task.`,
296-
isMax &&
309+
!noAskUser &&
310+
isMax &&
297311
'If needed, use the ask_user tool to ask the user for clarification on their request or alternate implementation strategies. It is good to get context on the codebase before asking questions so you can ask informed questions.',
298312
(isDefault || isMax) &&
299313
`- 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.`,
@@ -315,6 +329,7 @@ ${buildArray(
315329
`- Test your changes by running appropriate validation commands for the project (e.g. typechecks, tests, lints, etc.). Try to run all appropriate commands in parallel. ${isMax ? ' Typecheck and test the specific area of the project that you are editing *AND* then typecheck and test the entire project if necessary.' : ' If you can, only test the area of the project that you are editing, rather than the entire project.'} You may have to explore the project to find the appropriate commands. Don't skip this step!`,
316330
`- Inform the user that you have completed the task in one sentence or a few short bullet points.${isSonnet ? " Don't create any markdown summary files or example documentation files, unless asked by the user." : ''}`,
317331
!isFast &&
332+
!noAskUser &&
318333
`- After successfully completing an implementation, use the suggest_followups tool to suggest ~3 next steps the user might want to take (e.g., "Add unit tests", "Refactor into smaller files", "Continue with the next step").`,
319334
).join('\n')}`
320335
}
@@ -326,13 +341,15 @@ function buildImplementationStepPrompt({
326341
hasNoValidation,
327342
isSonnet,
328343
isLite,
344+
noAskUser,
329345
}: {
330346
isDefault: boolean
331347
isFast: boolean
332348
isMax: boolean
333349
hasNoValidation: boolean
334350
isSonnet: boolean
335351
isLite: boolean
352+
noAskUser: boolean
336353
}) {
337354
return buildArray(
338355
isMax &&
@@ -343,6 +360,7 @@ function buildImplementationStepPrompt({
343360
'Spawn code-reviewer to review the changes after you have implemented the changes and in parallel with typechecking or testing.',
344361
`After completing the user request, summarize your changes in a sentence${isFast ? '' : ' or a few short bullet points'}.${isSonnet ? " Don't create any summary markdown files or example documentation files, unless asked by the user." : ''} Don't repeat yourself, especially if you have already concluded and summarized the changes in a previous step -- just end your turn.`,
345362
!isFast &&
363+
!noAskUser &&
346364
`After a successful implementation, use the suggest_followups tool to suggest around 3 next steps the user might want to take.`,
347365
).join('\n')
348366
}

0 commit comments

Comments
 (0)