File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/agent-runtime/src/__tests__ Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,9 @@ describe('mainPrompt', () => {
200200 } ,
201201 }
202202
203- it ( 'includes local agents in spawnableAgents when agentId is provided' , async ( ) => {
203+ it ( 'does not include other local agents in spawnableAgents when agentId is provided' , async ( ) => {
204+ // When a specific agentId is provided, we only use the spawnable agents
205+ // defined in that agent's template - we don't auto-add all available agents
204206 const sessionState = getInitialSessionState ( mockFileContext )
205207 const mainAgentId = 'test-main-agent'
206208 const localAgentId = 'test-local-agent'
@@ -257,9 +259,12 @@ describe('mainPrompt', () => {
257259 localAgentTemplates,
258260 } )
259261
260- expect ( localAgentTemplates [ mainAgentId ] . spawnableAgents ) . toContain (
262+ // When agentId is provided, spawnableAgents should only contain what was
263+ // explicitly defined in the template (empty in this case)
264+ expect ( localAgentTemplates [ mainAgentId ] . spawnableAgents ) . not . toContain (
261265 localAgentId ,
262266 )
267+ expect ( localAgentTemplates [ mainAgentId ] . spawnableAgents ) . toEqual ( [ ] )
263268 } )
264269
265270 it ( 'should handle write_file tool call' , async ( ) => {
You can’t perform that action at this time.
0 commit comments