Skip to content

Commit 48861c6

Browse files
committed
Merge branch 'main' into openai-native
2 parents 7daafe3 + 528ce1a commit 48861c6

File tree

170 files changed

+7880
-2729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+7880
-2729
lines changed

.agents-graveyard/scout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
const definition: SecretAgentDefinition = {
88
id: 'scout',
99
publisher,
10-
model: 'openai/gpt-5-chat',
10+
model: 'openai/gpt-5.1-chat',
1111
displayName: 'Lewis & Clark',
1212
spawnableAgents: ['file-explorer', 'researcher-web', 'researcher-docs'],
1313
toolNames: ['spawn_agents', 'read_files', 'code_search', 'end_turn'],

.agents/base/ask.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { PLACEHOLDER } from '../types/secret-agent-definition'
99
const definition: SecretAgentDefinition = {
1010
id: 'ask',
1111
publisher,
12-
model: 'openai/gpt-5',
12+
model: 'openai/gpt-5.1',
1313
displayName: 'Ask Buffy',
1414
spawnerPrompt: 'Base ask-mode agent that orchestrates the full response.',
1515
inputSchema: {

.agents/base/base-lite.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { baseAgentAgentStepPrompt } from './base-prompts.ts'
77
const definition: SecretAgentDefinition = {
88
id: 'base-lite',
99
publisher,
10-
...base('openai/gpt-5', 'lite'),
10+
...base('openai/gpt-5.1', 'lite'),
1111
reasoningOptions: {
1212
enabled: true,
1313
effort: 'medium',
@@ -33,7 +33,7 @@ const definition: SecretAgentDefinition = {
3333
],
3434

3535
stepPrompt:
36-
baseAgentAgentStepPrompt('openai/gpt-5') +
36+
baseAgentAgentStepPrompt('openai/gpt-5.1') +
3737
` Don't forget to spawn any helper agents as you go: file-explorer, find-all-referencer, researcher-web, researcher-docs, thinker, reviewer-lite`,
3838
}
3939

.agents/base/base-quick.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { SecretAgentDefinition } from '../types/secret-agent-definition'
66
const definition: SecretAgentDefinition = {
77
id: 'base-quick',
88
publisher,
9-
...base('openai/gpt-5-chat', 'lite'),
9+
...base('openai/gpt-5.1-chat', 'lite'),
1010
toolNames: [
1111
'create_plan',
1212
'run_terminal_command',

.agents/base2/alloy/base2-gpt-5-single-step.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { SecretAgentDefinition } from '../../types/secret-agent-definition'
44
const definition: SecretAgentDefinition = {
55
...createBase2('default'),
66
id: 'base2-gpt-5-single-step',
7-
model: 'openai/gpt-5',
7+
model: 'openai/gpt-5.1',
88
reasoningOptions: {
99
enabled: true,
1010
effort: 'medium',

.agents/base2/alloy2/base2-plan-step-gpt-5.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { SecretAgentDefinition } from '../../types/secret-agent-definition'
44
const definition: SecretAgentDefinition = {
55
...planStep,
66
id: 'base2-plan-step-gpt-5',
7-
model: 'openai/gpt-5',
7+
model: 'openai/gpt-5.1',
88
}
99

1010
export default definition
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', { hasCodeReviewerBestOfN: true }),
5+
id: 'base2-max-with-code-reviewer-best-of-n',
6+
displayName: 'Buffy the Code Reviewing Best-of-N Max Orchestrator',
7+
}
8+
export default definition
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', { hasCodeReviewerBestOfN: true }),
5+
id: 'base2-with-code-reviewer-best-of-n',
6+
displayName: 'Buffy the Code Reviewing Best-of-N Orchestrator',
7+
}
8+
export default definition
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', { hasCodeReviewer: true }),
5+
id: 'base2-with-code-reviewer',
6+
displayName: 'Buffy the Code Reviewing Orchestrator',
7+
}
8+
export default definition

.agents/base2/base2.ts

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,16 @@ export function createBase2(
1111
options?: {
1212
hasNoValidation?: boolean
1313
planOnly?: boolean
14+
hasCodeReviewer?: boolean
15+
hasCodeReviewerBestOfN?: boolean
1416
},
1517
): Omit<SecretAgentDefinition, 'id'> {
16-
const { hasNoValidation = false, planOnly = false } = options ?? {}
18+
const {
19+
hasNoValidation = false,
20+
planOnly = false,
21+
hasCodeReviewer = false,
22+
hasCodeReviewerBestOfN = false,
23+
} = options ?? {}
1724
const isDefault = mode === 'default'
1825
const isFast = mode === 'fast'
1926
const isMax = mode === 'max'
@@ -24,7 +31,7 @@ export function createBase2(
2431
return {
2532
publisher,
2633
model: isGpt5
27-
? 'openai/gpt-5'
34+
? 'openai/gpt-5.1'
2835
: isFast
2936
? 'z-ai/glm-4.6:nitro'
3037
: 'anthropic/claude-sonnet-4.5',
@@ -74,6 +81,9 @@ export function createBase2(
7481
isGpt5 && 'editor-best-of-n-gpt-5',
7582
isDefault && 'thinker-best-of-n',
7683
isGpt5 && 'thinker-best-of-n-gpt-5',
84+
hasCodeReviewer && (isGpt5 ? 'code-reviewer-gpt-5' : 'code-reviewer'),
85+
hasCodeReviewerBestOfN &&
86+
(isGpt5 ? 'code-reviewer-best-of-n-gpt-5' : 'code-reviewer-best-of-n'),
7787
'context-pruner',
7888
),
7989

@@ -123,8 +133,12 @@ Use the spawn_agents tool to spawn specialized agents to help you complete the u
123133
- **Sequence agents properly:** Keep in mind dependencies when spawning different agents. Don't spawn agents in parallel that depend on each other.
124134
${buildArray(
125135
'- Spawn context-gathering agents (file pickers, code-searcher, directory-lister, glob-matcher, and web/docs researchers) before making edits.',
126-
`- Spawn a ${isGpt5 ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} agent to implement the changes after you have gathered all the context you need. Don't spawn the editor in parallel with context-gathering agents.`,
136+
`- Spawn a ${isGpt5 ? '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.`,
127137
'- Spawn commanders sequentially if the second command depends on the the first.',
138+
hasCodeReviewer &&
139+
'- Spawn a code-reviewer agent to review the code changes after you have made them.',
140+
hasCodeReviewerBestOfN &&
141+
'- Spawn a code-reviewer-best-of-n agent to review the code changes after you have made them.',
128142
).join('\n ')}
129143
- **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.
130144
@@ -170,10 +184,13 @@ ${PLACEHOLDER.GIT_CHANGES_PROMPT}
170184
isDefault,
171185
isMax,
172186
hasNoValidation,
187+
hasCodeReviewer,
188+
hasCodeReviewerBestOfN,
173189
}),
174190
stepPrompt: planOnly
175191
? buildPlanOnlyStepPrompt({})
176192
: buildImplementationStepPrompt({
193+
isFast,
177194
isMax,
178195
isGpt5,
179196
hasNoValidation,
@@ -210,13 +227,17 @@ function buildImplementationInstructionsPrompt({
210227
isDefault,
211228
isMax,
212229
hasNoValidation,
230+
hasCodeReviewer,
231+
hasCodeReviewerBestOfN,
213232
}: {
214233
isSonnet: boolean
215234
isGpt5: boolean
216235
isFast: boolean
217236
isDefault: boolean
218237
isMax: boolean
219238
hasNoValidation: boolean
239+
hasCodeReviewer: boolean
240+
hasCodeReviewerBestOfN: boolean
220241
}) {
221242
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.
222243
@@ -227,9 +248,13 @@ The user asks you to implement a new feature. You respond in multiple steps:
227248
${buildArray(
228249
EXPLORE_PROMPT,
229250
`- 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.`,
230-
`- 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.${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.`,
251+
`- 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.${hasCodeReviewer ? ' Include a step to review the code changes with the code-reviewer agent after you have made them.' : ''}${hasCodeReviewerBestOfN ? ' Include a step to review the code changes with the code-reviewer-best-of-n agent after you have made them.' : ''}${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.`,
231252
!isFast &&
232-
`- You must spawn the ${isGpt5 ? '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.`,
253+
`- IMPORTANT: You must spawn the ${isGpt5 ? '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.`,
254+
hasCodeReviewer &&
255+
`- Spawn a code-reviewer agent to review the code changes after you have made them. You can skip this step for small changes that are obvious and don't require a review.`,
256+
hasCodeReviewerBestOfN &&
257+
`- Spawn a code-reviewer-best-of-n agent to review the code changes after you have made them. You can skip this step for small changes that are obvious and don't require a review.`,
233258
!hasNoValidation &&
234259
`- Test your changes${isMax ? '' : ' briefly'} by running appropriate validation commands for the project (e.g. typechecks, tests, lints, etc.).${isMax ? ' Start by type checking the specific area of the project that you are editing and then test the entire project if necessary.' : ' If you can, only typecheck/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!`,
235260
`- 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." : ''}`,
@@ -238,11 +263,13 @@ ${buildArray(
238263
}
239264

240265
function buildImplementationStepPrompt({
266+
isFast,
241267
isMax,
242268
isGpt5,
243269
hasNoValidation,
244270
isSonnet,
245271
}: {
272+
isFast: boolean
246273
isMax: boolean
247274
isGpt5: boolean
248275
hasNoValidation: boolean
@@ -251,9 +278,11 @@ function buildImplementationStepPrompt({
251278
return buildArray(
252279
isMax &&
253280
`Keep working until the user's request is completely satisfied${!hasNoValidation ? ' and validated' : ''}, or until you require more information from the user.`,
254-
`After completing the user request, summarize your changes in a sentence 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.`,
281+
!isFast &&
282+
`You must spawn the ${isGpt5 ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} agent to implement code changes, since it will generate the best code changes.`,
283+
`After completing the user request, summarize your changes in a sentence 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.`,
255284
isGpt5 &&
256-
`IMPORTANT: You should include at least one tool call ("<codebuff_tool_call>") per message response. If you are completely done with the user's request or require more information from the user, you must call the task_completed tool to end your turn.`,
285+
`IMPORTANT: You must include at least one tool call ("<codebuff_tool_call>") per message response. If you are completely done with the user's request or require more information from the user, you must call the task_completed tool to end your turn.`,
257286
).join('\n')
258287
}
259288

@@ -289,20 +318,23 @@ It should not include:
289318
290319
This is more like an extremely short PRD which describes the end result of what the user wants. Think of it like fleshing out the user's prompt to make it more precise, although it should be as short as possible.
291320
292-
## Questions
321+
## Follow-up questions
293322
294-
After closing the <PLAN> tags, the last optional section is Questions, which is a Questions header with a numbered list of questions and alternate choices demarcated by letters.
323+
After closing the <PLAN> tags, the last optional section is Follow-up questions, which has a numbered list of questions and alternate choices demarcated by letters to clarify and improve upon the spec. These questions are optional for to complete for the user.
295324
296-
For example, here is a nice short question, where the options are helpfully written out for the user:
325+
For example, here is a nice short follow-up question, where the options are helpfully written out for the user, with the answers a) and b) indented with two spaces for readability:
297326
298-
Questions:
327+
<example>
328+
## Optional follow-up questions:
299329
300330
1. Do you want to:
301-
a) (DEFAULT) Keep Express and integrate Bun WebSockets
331+
a) (CURRENT) Keep Express and integrate Bun WebSockets
302332
b) Migrate the entire HTTP server to Bun.serve()
333+
</example>
303334
304335
Try to have as few questions as possible (even none), and focus on the most important decisions or assumptions that it would be helpful to clarify with the user.
305-
You should also let them know what you plan to do by default, and let them know that they can choose a different option if they want to.
336+
337+
You should also let them know what the plan currently does by default by labeling that option with "(CURRENT)", and let them know that they can choose a different option if they want to.
306338
307339
The questions section should be last and there should be no summary or further elaboration. Just end your turn.
308340

0 commit comments

Comments
 (0)