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
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ describe('ToolCallEmitter', () => {
expect(emitter.mapToolKind(Kind.Execute)).toBe('execute');
expect(emitter.mapToolKind(Kind.Think)).toBe('think');
expect(emitter.mapToolKind(Kind.Fetch)).toBe('fetch');
// Kind.Agent maps to 'other' on the wire: ACP has no 'agent' ToolKind,
// so emitting it would be Zod-rejected at the daemon's ACP boundary.
expect(emitter.mapToolKind(Kind.Agent)).toBe('other');
expect(emitter.mapToolKind(Kind.Other)).toBe('other');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ const KIND_MAP: Record<Kind, ToolKind> = {
[Kind.Execute]: 'execute',
[Kind.Think]: 'think',
[Kind.Fetch]: 'fetch',
// ACP defines no 'agent' ToolKind (verified through @agentclientprotocol/sdk
// 0.25.1). The daemon's ClientSideConnection Zod-validates every session/update
// and session/request_permission from the `qwen --acp` child before fanning out
// to SSE clients, so emitting 'agent' is rejected at that hop and the frame is
// dropped. Map the internal Kind.Agent to 'other' on the wire to stay
// protocol-valid; dedicated agent UI is delivered out-of-band (via _meta.toolName)
// in a follow-up rather than via a kind the protocol can't carry.
[Kind.Agent]: 'other',
[Kind.Other]: 'other',
};

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/core/coreToolScheduler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8322,7 +8322,7 @@ describe('Fire hook functions integration', () => {

const agentTool = new MockTool({
name: ToolNames.AGENT,
kind: Kind.Other,
kind: Kind.Agent,
execute: async (params) => {
const id = (params as { id: string }).id;
executionLog.push(`agent:start:${id}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tools/agent/agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ describe('AgentTool', () => {
it('should initialize with correct name and properties', () => {
expect(agentTool.name).toBe('agent');
expect(agentTool.displayName).toBe('Agent');
expect(agentTool.kind).toBe('other');
expect(agentTool.kind).toBe('agent');
});

it('should load available subagents during initialization', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tools/agent/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ export class AgentTool extends BaseDeclarativeTool<AgentParams, ToolResult> {
AgentTool.Name,
ToolDisplayNames.AGENT,
'Launch a new agent to handle complex, multi-step tasks autonomously.\n\nThe Agent tool launches specialized agents (subprocesses) that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it.\n\nAvailable agent types and the tools they have access to:\n',
Kind.Other,
Kind.Agent,
initialSchema,
true, // isOutputMarkdown
true, // canUpdateOutput - Enable live output updates for real-time progress
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/tools/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ export enum Kind {
Execute = 'execute',
Think = 'think',
Fetch = 'fetch',
Agent = 'agent',
Other = 'other',
}

Expand Down
Loading