File tree Expand file tree Collapse file tree 4 files changed +23
-3
lines changed
Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -173,9 +173,19 @@ export const mainPrompt = async (
173173 let updatedSubagents = mainAgentTemplate . spawnableAgents
174174 if ( ! agentId ) {
175175 // If --agent is not specified, use the spawnableAgents from the codebuff config or add all local agents
176+ const {
177+ spawnableAgents,
178+ addedSpawnableAgents = [ ] ,
179+ removedSpawnableAgents = [ ] ,
180+ } = fileContext . codebuffConfig ?? { }
176181 updatedSubagents =
177- fileContext . codebuffConfig ?. spawnableAgents ??
182+ spawnableAgents ??
178183 uniq ( [ ...mainAgentTemplate . spawnableAgents , ...availableAgents ] )
184+
185+ updatedSubagents = uniq ( [
186+ ...updatedSubagents ,
187+ ...addedSpawnableAgents ,
188+ ] ) . filter ( ( subagent ) => ! removedSpawnableAgents . includes ( subagent ) )
179189 }
180190 mainAgentTemplate . spawnableAgents = updatedSubagents
181191 localAgentTemplates [ agentType ] = mainAgentTemplate
Original file line number Diff line number Diff line change 11{
22 "description" : " Template configuration for this project. See https://www.codebuff.com/config for all options." ,
3+ "addedSpawnableAgents" : [" codebuff/git-commiter@0.0.1" ],
34 "startupProcesses" : [
45 {
56 "name" : " drizzle" ,
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export const FileChangeHook = z
6666 . describe ( 'Defines a single file change hook.' )
6767
6868export const CodebuffConfigSchema = z
69- . object ( {
69+ . looseObject ( {
7070 description : z
7171 . any ( )
7272 . optional ( )
@@ -87,6 +87,14 @@ export const CodebuffConfigSchema = z
8787 'Maximum number of turns agent will take before being forced to end' ,
8888 ) ,
8989 baseAgent : z . string ( ) . optional ( ) . describe ( 'Specify default base agent' ) ,
90+ addedSpawnableAgents : z
91+ . array ( z . string ( ) )
92+ . optional ( )
93+ . describe ( 'Specify additional agents that the base agent can spawn' ) ,
94+ removedSpawnableAgents : z
95+ . array ( z . string ( ) )
96+ . optional ( )
97+ . describe ( 'Specify which agents the base agent cannot spawn' ) ,
9098 spawnableAgents : z
9199 . array ( z . string ( ) )
92100 . optional ( )
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export function getDefaultConfig(): CodebuffConfig {
99 maxAgentSteps : MAX_AGENT_STEPS_DEFAULT ,
1010 baseAgent : undefined ,
1111 spawnableAgents : undefined ,
12+ addedSpawnableAgents : undefined ,
13+ removedSpawnableAgents : undefined ,
1214 }
1315}
14-
You can’t perform that action at this time.
0 commit comments