Skip to content

Commit a31ede0

Browse files
committed
Tweak best-of-n-selector, gpt-5-worker
1 parent 8be1e0d commit a31ede0

File tree

3 files changed

+58
-43
lines changed

3 files changed

+58
-43
lines changed

.agents/base2/base2-gpt-5-worker.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ const definition: SecretAgentDefinition = {
2828
2929
The user asks you to implement a new feature. You respond in multiple steps:
3030
31-
- Gather context on the user's request
31+
- Gather context on the user's request by spawning agents and reading files.
3232
- Use the write_todos tool to write out your step-by-step implementation plan.
3333
- Use the best-of-n-orchestrator tool to implement the changes. This is the best way to make high quality code changes -- strongly prefer using this agent over the str_replace or write_file tool.
3434
- For smaller fixes, use the str_replace or write_file tool to make the changes.
35-
- Test your changes 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.
36-
- End your turn.`,
35+
- Test your changes 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.`,
3736

3837
stepPrompt: undefined,
3938
}

.agents/base2/best-of-n/best-of-n-selector-gpt-5.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import type { SecretAgentDefinition } from '../../types/secret-agent-definition'
2-
import base2Selector from './best-of-n-selector'
2+
import { createBestOfNSelector } from './best-of-n-selector'
33

44
const definition: SecretAgentDefinition = {
5-
...base2Selector,
5+
...createBestOfNSelector({ model: 'gpt-5' }),
66
id: 'best-of-n-selector-gpt-5',
7-
model: 'openai/gpt-5',
87
displayName: 'Best-of-N GPT-5 Implementation Selector',
98
}
109

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

Lines changed: 54 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,57 @@ import {
44
} from '../../types/secret-agent-definition'
55
import { publisher } from '../../constants'
66

7-
const definition: SecretAgentDefinition = {
8-
id: 'best-of-n-selector',
9-
publisher,
10-
model: 'anthropic/claude-sonnet-4.5',
11-
displayName: 'Best-of-N Implementation Selector',
12-
spawnerPrompt:
13-
'Analyzes multiple implementation proposals and selects the best one',
7+
export const createBestOfNSelector = (options: {
8+
model: 'sonnet' | 'gpt-5'
9+
}): Omit<SecretAgentDefinition, 'id'> => {
10+
const { model } = options
11+
const isSonnet = model === 'sonnet'
1412

15-
includeMessageHistory: true,
16-
inheritParentSystemPrompt: true,
13+
return {
14+
publisher,
15+
model: isSonnet ? 'anthropic/claude-sonnet-4.5' : 'openai/gpt-5',
16+
displayName: 'Best-of-N Implementation Selector',
17+
spawnerPrompt:
18+
'Analyzes multiple implementation proposals and selects the best one',
1719

18-
toolNames: ['set_output'],
19-
spawnableAgents: [],
20+
includeMessageHistory: true,
21+
inheritParentSystemPrompt: true,
2022

21-
inputSchema: {
22-
params: {
23-
type: 'object',
24-
properties: {
25-
implementations: {
26-
type: 'array',
27-
items: {
28-
type: 'object',
29-
properties: {
30-
id: { type: 'string' },
31-
content: { type: 'string' },
23+
toolNames: ['set_output'],
24+
spawnableAgents: [],
25+
26+
inputSchema: {
27+
params: {
28+
type: 'object',
29+
properties: {
30+
implementations: {
31+
type: 'array',
32+
items: {
33+
type: 'object',
34+
properties: {
35+
id: { type: 'string' },
36+
content: { type: 'string' },
37+
},
38+
required: ['id', 'content'],
3239
},
33-
required: ['id', 'content'],
3440
},
3541
},
42+
required: ['implementations'],
3643
},
37-
required: ['implementations'],
3844
},
39-
},
40-
outputMode: 'structured_output',
41-
outputSchema: {
42-
type: 'object',
43-
properties: {
44-
implementationId: {
45-
type: 'string',
46-
description: 'The id of the chosen implementation',
45+
outputMode: 'structured_output',
46+
outputSchema: {
47+
type: 'object',
48+
properties: {
49+
implementationId: {
50+
type: 'string',
51+
description: 'The id of the chosen implementation',
52+
},
4753
},
54+
required: ['implementationId'],
4855
},
49-
required: ['implementationId'],
50-
},
5156

52-
instructionsPrompt: `As part of the best-of-n workflow of agents, you are the implementation selector agent.
57+
instructionsPrompt: `As part of the best-of-n workflow of agents, you are the implementation selector agent.
5358
5459
## Task Instructions
5560
@@ -79,9 +84,21 @@ Try to select an implementation that fulfills all the requirements in the user's
7984
8085
## Response Format
8186
82-
If needed, use <think> tags to briefly consider the implementations and their strengths and weaknesses.
87+
${
88+
isSonnet
89+
? `Use <think> tags to briefly consider the implementations as needed to pick the best implementation.
90+
91+
If the best one is obvious or the implementations are very similar, you may not need to think very much (a few words suffice) or you may not need to use think tags at all, just pick the best one and output it. You have a dual goal of picking the best implementation and being fast (using as few words as possible).
92+
93+
Then, do not write any other explanations AT ALL. You should directly output a single tool call to set_output with the selected implementationId.`
94+
: `Output a single tool call to set_output with the selected implementationId. Do not write anything else.`
95+
}`,
96+
}
97+
}
8398

84-
Then, do not write any other explanations AT ALL. You should directly output a single tool call to set_output with the selected implementationId.`,
99+
const definition: SecretAgentDefinition = {
100+
...createBestOfNSelector({ model: 'sonnet' }),
101+
id: 'best-of-n-selector',
85102
}
86103

87104
export default definition

0 commit comments

Comments
 (0)