Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/core/src/tools/list-agents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,22 @@ describe('ListAgentsTool', () => {

expect(tool.name).toBe('list_agents');
expect(result.llmContent).toBe(
'No background agents are available in this session.',
'No ordinary background subagents are available in this session. ' +
'Named Agent Team teammates are not listed here; their results are ' +
'delivered automatically through team messaging, so do not use ' +
'list_agents to wait for a teammate.',
);
});

it('states the Agent Team boundary in the tool description', () => {
expect(tool.description).toContain(
'Named Agent Team teammates are NOT listed here',
);
expect(tool.description).toContain(
'deliver their final reports automatically',
);
expect(tool.description).toContain(
'do not use list_agents (or poll task_list) to wait for a teammate',
);
});

Expand Down
18 changes: 13 additions & 5 deletions packages/core/src/tools/list-agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ListAgentsInvocation extends BaseToolInvocation<
}

getDescription(): string {
return 'List background agents';
return 'List ordinary background subagents';
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
}

async execute(): Promise<ToolResult> {
Expand All @@ -52,7 +52,11 @@ class ListAgentsInvocation extends BaseToolInvocation<
}));

if (agents.length === 0) {
const message = 'No background agents are available in this session.';
const message =
Comment thread
yiliang114 marked this conversation as resolved.
'No ordinary background subagents are available in this session. ' +
'Named Agent Team teammates are not listed here; their results are ' +
'delivered automatically through team messaging, so do not use ' +
'list_agents to wait for a teammate.';
return { llmContent: message, returnDisplay: message };
}

Expand All @@ -75,9 +79,13 @@ export class ListAgentsTool extends BaseDeclarativeTool<
super(
ListAgentsTool.Name,
ToolDisplayNames.LIST_AGENTS,
'List addressable background agents in the current session, including ' +
'agents restored from a prior session run. Use the returned task_id ' +
'with send_message to continue a running, paused, or completed agent.',
'List addressable ordinary background subagents in the current ' +
'session, including agents restored from a prior session run. Named ' +
'Agent Team teammates are NOT listed here: they have their own team ' +
'lifecycle and deliver their final reports automatically, so do not ' +
'use list_agents (or poll task_list) to wait for a teammate. Use the ' +
'returned task_id with send_message to continue a running, paused, ' +
'or completed agent.',
Kind.Read,
{
type: 'object',
Expand Down
Loading