Skip to content

Commit a6ca5ec

Browse files
committed
fix tests
1 parent f2a4d8f commit a6ca5ec

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/agent-runtime/src/__tests__/main-prompt.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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 () => {

0 commit comments

Comments
 (0)