Skip to content

Commit 7d67112

Browse files
committed
gpt-5 general agent: Don't give it file-picker as it reads all the returned files every time lol
1 parent cf509f8 commit 7d67112

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

agents/general-agent/general-agent.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { buildArray } from '@codebuff/common/util/array'
12
import { publisher } from '../constants'
23

34
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
@@ -42,16 +43,16 @@ export const createGeneralAgent = (options: {
4243
},
4344
},
4445
outputMode: 'last_message',
45-
spawnableAgents: [
46+
spawnableAgents: buildArray(
4647
'researcher-web',
4748
'researcher-docs',
48-
'file-picker',
49+
!isGpt5 && 'file-picker',
4950
'code-searcher',
5051
'directory-lister',
5152
'glob-matcher',
5253
'commander',
5354
'context-pruner',
54-
],
55+
),
5556
toolNames: [
5657
'spawn_agents',
5758
'read_files',
@@ -60,7 +61,10 @@ export const createGeneralAgent = (options: {
6061
'write_file',
6162
],
6263

63-
instructionsPrompt: `Use the spawn_agents tool to spawn agents to help you complete the user request. If you need to find more information in the codebase, file-picker is really good at finding relevant files. You should spawn multiple agents in parallel when possible to speed up the process. (e.g. spawn 3 file-pickers + 1 code-searcher + 1 researcher-web in one spawn_agents call or 3 commanders in one spawn_agents call).`,
64+
instructionsPrompt: buildArray(
65+
`Use the spawn_agents tool to spawn agents to help you complete the user request.`,
66+
!isGpt5 && `If you need to find more information in the codebase, file-picker is really good at finding relevant files. You should spawn multiple agents in parallel when possible to speed up the process. (e.g. spawn 3 file-pickers + 1 code-searcher + 1 researcher-web in one spawn_agents call or 3 commanders in one spawn_agents call).`,
67+
).join('\n'),
6468

6569
handleSteps: function* ({ params }) {
6670
const filePaths = params?.filePaths as string[] | undefined

0 commit comments

Comments
 (0)