Skip to content

Commit a784106

Browse files
committed
--agent doesn't not modify subagents
1 parent 5daa442 commit a784106

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.agents/file-explorer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const config: AgentConfig = {
1313
outputMode: 'json',
1414
includeMessageHistory: false,
1515
toolNames: ['spawn_agents', 'set_output'],
16-
subagents: [`codebuff/file-picker@${version}`],
16+
subagents: [`file-picker`],
1717
inputSchema: {
1818
prompt: {
1919
description: 'What you need to accomplish by exploring the codebase',

backend/src/main-prompt.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,13 @@ export const mainPrompt = async (
168168
throw new Error(`Agent template not found for type: ${agentType}`)
169169
}
170170

171-
// Update the main agent template with subagents from codebuff config or add all dynamic agents
172-
const updatedSubagents =
173-
fileContext.codebuffConfig?.subagents ??
174-
uniq([...mainAgentTemplate.subagents, ...availableAgents])
171+
let updatedSubagents = mainAgentTemplate.subagents
172+
if (!agentId) {
173+
// If --agent is not specified, use the subagents from the codebuff config or add all local agents
174+
updatedSubagents =
175+
fileContext.codebuffConfig?.subagents ??
176+
uniq([...mainAgentTemplate.subagents, ...availableAgents])
177+
}
175178
mainAgentTemplate.subagents = updatedSubagents
176179
localAgentTemplates[agentType] = mainAgentTemplate
177180

npm-app/src/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,10 @@ async function codebuff({
5555

5656
// Only load local agents if no specific agent is requested
5757
const loadLocalAgentsPromise = new Promise<void>((resolve) => {
58-
if (!agent) {
59-
loadLocalAgents({ verbose: true }).then(() => {
60-
const codebuffConfig = loadCodebuffConfig()
61-
displayLoadedAgents(codebuffConfig)
62-
})
63-
}
58+
loadLocalAgents({ verbose: true }).then(() => {
59+
const codebuffConfig = loadCodebuffConfig()
60+
displayLoadedAgents(codebuffConfig)
61+
})
6462
resolve()
6563
})
6664

0 commit comments

Comments
 (0)