Skip to content

Commit b41e3bd

Browse files
committed
Test base2-gemini-editor
1 parent b40121d commit b41e3bd

File tree

4 files changed

+44
-12
lines changed

4 files changed

+44
-12
lines changed
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('default', { useGeminiEditor: true }),
5+
id: 'base2-gemini-editor',
6+
displayName: 'Buffy the Gemini Editor Orchestrator',
7+
}
8+
export default definition

.agents/base2/base2.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ export function createBase2(
1212
hasNoValidation?: boolean
1313
planOnly?: boolean
1414
withGemini?: boolean
15+
useGeminiEditor?: boolean
1516
},
1617
): Omit<SecretAgentDefinition, 'id'> {
1718
const {
1819
hasNoValidation = mode === 'fast',
1920
planOnly = false,
2021
withGemini = false,
22+
useGeminiEditor = false,
2123
} = options ?? {}
2224
const isDefault = mode === 'default'
2325
const isFast = mode === 'fast'
@@ -67,11 +69,15 @@ export function createBase2(
6769
'researcher-web',
6870
'researcher-docs',
6971
'commander',
70-
withGemini && 'editor-best-of-n-gemini',
71-
!withGemini && isDefault && 'editor-best-of-n',
72-
!withGemini && isMax && 'editor-best-of-n-gpt-5',
73-
!withGemini && isDefault && 'thinker-best-of-n',
74-
!withGemini && isMax && 'thinker-best-of-n-gpt-5',
72+
useGeminiEditor
73+
? 'editor-implementor-gemini'
74+
: buildArray(
75+
withGemini && 'editor-best-of-n-gemini',
76+
!withGemini && isDefault && 'editor-best-of-n',
77+
!withGemini && isMax && 'editor-best-of-n-gpt-5',
78+
!withGemini && isDefault && 'thinker-best-of-n',
79+
!withGemini && isMax && 'thinker-best-of-n-gpt-5',
80+
),
7581
!withGemini && isDefault && 'code-reviewer',
7682
!withGemini && isMax && 'code-reviewer-best-of-n-gpt-5',
7783
'context-pruner',
@@ -125,7 +131,7 @@ Use the spawn_agents tool to spawn specialized agents to help you complete the u
125131
'- Spawn context-gathering agents (file pickers, code-searcher, directory-lister, glob-matcher, and web/docs researchers) before making edits.',
126132
isMax &&
127133
'- Spawn the thinker-best-of-n-gpt-5 after gathering context to solve complex problems.',
128-
`- Spawn a ${isMax ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} 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.`,
134+
`- Spawn a ${useGeminiEditor ? 'editor-implementor-gemini' : isMax ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} 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.`,
129135
'- Spawn commanders sequentially if the second command depends on the the first.',
130136
!isFast &&
131137
`- Spawn a ${isDefault ? 'code-reviewer' : 'code-reviewer-best-of-n-gpt-5'} to review the changes after you have implemented the changes.`,
@@ -263,6 +269,7 @@ ${PLACEHOLDER.GIT_CHANGES_PROMPT}
263269
isDefault,
264270
isMax,
265271
hasNoValidation,
272+
useGeminiEditor,
266273
}),
267274
stepPrompt: planOnly
268275
? buildPlanOnlyStepPrompt({})
@@ -271,6 +278,7 @@ ${PLACEHOLDER.GIT_CHANGES_PROMPT}
271278
isMax,
272279
hasNoValidation,
273280
isSonnet,
281+
useGeminiEditor,
274282
}),
275283

276284
handleSteps: function* ({ params }) {
@@ -302,12 +310,14 @@ function buildImplementationInstructionsPrompt({
302310
isDefault,
303311
isMax,
304312
hasNoValidation,
313+
useGeminiEditor,
305314
}: {
306315
isSonnet: boolean
307316
isFast: boolean
308317
isDefault: boolean
309318
isMax: boolean
310319
hasNoValidation: boolean
320+
useGeminiEditor: boolean
311321
}) {
312322
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.
313323
@@ -320,13 +330,13 @@ ${buildArray(
320330
!isFast &&
321331
`- 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.`,
322332
!isFast &&
323-
`- 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.'} Skip write_todos for simple tasks like quick edits or answering questions.`,
333+
`- 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.`,
324334
isFast &&
325335
'- Implement the changes in one go. Pause after making all the changes to see the tool results of your edits.',
326336
isFast &&
327337
'- Do a single typecheck targeted for your changes at most (if applicable for the project). Or skip this step if the change was small.',
328338
!isFast &&
329-
`- IMPORTANT: You must spawn the ${isMax ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} agent to implement non-trivial code changes, since it will generate the best code changes from multiple implementation proposals. This is the best way to make high quality code changes -- strongly prefer using this agent over the str_replace or write_file tools, unless the change is very straightforward and obvious.`,
339+
`- IMPORTANT: You must spawn the ${useGeminiEditor ? 'editor-implementor-gemini' : isMax ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} agent to implement non-trivial code changes, since it will generate the best code changes from multiple implementation proposals. This is the best way to make high quality code changes -- strongly prefer using this agent over the str_replace or write_file tools, unless the change is very straightforward and obvious.`,
330340
!isFast &&
331341
`- Spawn a ${isDefault ? 'code-reviewer' : 'code-reviewer-best-of-n-gpt-5'} to review the changes after you have implemented the changes. (Skip this step only if the change is extremely straightforward and obvious.)`,
332342
!hasNoValidation &&
@@ -340,17 +350,19 @@ function buildImplementationStepPrompt({
340350
isMax,
341351
hasNoValidation,
342352
isSonnet,
353+
useGeminiEditor,
343354
}: {
344355
isFast: boolean
345356
isMax: boolean
346357
hasNoValidation: boolean
347358
isSonnet: boolean
359+
useGeminiEditor: boolean
348360
}) {
349361
return buildArray(
350362
isMax &&
351363
`Keep working until the user's request is completely satisfied${!hasNoValidation ? ' and validated' : ''}, or until you require more information from the user.`,
352364
!isFast &&
353-
`You must spawn the ${isMax ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} agent to implement code changes, since it will generate the best code changes.`,
365+
`You must spawn the ${useGeminiEditor ? 'editor-implementor-gemini' : isMax ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} agent to implement code changes, since it will generate the best code changes.`,
354366
isMax && 'Spawn the thinker-best-of-n-gpt-5 to solve complex problems.',
355367
`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 already summarized your changes then just end your turn.`,
356368
).join('\n')
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { createBestOfNImplementor } from './editor-implementor-gpt-5'
2+
3+
const definition = {
4+
...createBestOfNImplementor({ model: 'gemini' }),
5+
id: 'editor-implementor-gemini',
6+
}
7+
export default definition

.agents/editor/best-of-n/editor-implementor-gpt-5.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ import { publisher } from '../../constants'
33
import type { SecretAgentDefinition } from '../../types/secret-agent-definition'
44

55
export const createBestOfNImplementor = (options: {
6-
model: 'sonnet' | 'gpt-5'
6+
model: 'sonnet' | 'gpt-5' | 'gemini'
77
}): Omit<SecretAgentDefinition, 'id'> => {
88
const { model } = options
99
const isSonnet = model === 'sonnet'
1010
const isGpt5 = model === 'gpt-5'
11+
const isGemini = model === 'gemini'
1112

1213
return {
1314
publisher,
14-
model: isSonnet ? 'anthropic/claude-sonnet-4.5' : 'openai/gpt-5.1',
15+
model: isSonnet
16+
? 'anthropic/claude-sonnet-4.5'
17+
: isGemini
18+
? 'google/gemini-3-pro-preview'
19+
: 'openai/gpt-5.1',
1520
displayName: 'Implementation Generator',
1621
spawnerPrompt:
1722
'Generates a complete implementation plan with all code changes',
@@ -61,7 +66,7 @@ OR for new files or major rewrites:
6166
}
6267
</codebuff_tool_call>
6368
${
64-
isGpt5
69+
isGpt5 || isGemini
6570
? ``
6671
: `
6772
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.

0 commit comments

Comments
 (0)