mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -07:00
feat(core): introduce Kind.Agent for sub-agent classification (#20369)
This commit is contained in:
@@ -1335,6 +1335,8 @@ function toAcpToolKind(kind: Kind): acp.ToolKind {
|
||||
case Kind.SwitchMode:
|
||||
case Kind.Other:
|
||||
return kind as acp.ToolKind;
|
||||
case Kind.Agent:
|
||||
return 'think';
|
||||
case Kind.Plan:
|
||||
case Kind.Communicate:
|
||||
default:
|
||||
|
||||
@@ -70,7 +70,7 @@ describe('SubagentToolWrapper', () => {
|
||||
expect(wrapper.name).toBe(mockDefinition.name);
|
||||
expect(wrapper.displayName).toBe(mockDefinition.displayName);
|
||||
expect(wrapper.description).toBe(mockDefinition.description);
|
||||
expect(wrapper.kind).toBe(Kind.Think);
|
||||
expect(wrapper.kind).toBe(Kind.Agent);
|
||||
expect(wrapper.isOutputMarkdown).toBe(true);
|
||||
expect(wrapper.canUpdateOutput).toBe(true);
|
||||
});
|
||||
|
||||
@@ -45,7 +45,7 @@ export class SubagentToolWrapper extends BaseDeclarativeTool<
|
||||
definition.name,
|
||||
definition.displayName ?? definition.name,
|
||||
definition.description,
|
||||
Kind.Think,
|
||||
Kind.Agent,
|
||||
definition.inputConfig.inputSchema,
|
||||
messageBus,
|
||||
/* isOutputMarkdown */ true,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import { SubagentTool } from './subagent-tool.js';
|
||||
import { SubagentToolWrapper } from './subagent-tool-wrapper.js';
|
||||
import { Kind } from '../tools/tools.js';
|
||||
import type {
|
||||
LocalAgentDefinition,
|
||||
RemoteAgentDefinition,
|
||||
@@ -70,6 +71,11 @@ describe('SubAgentInvocation', () => {
|
||||
.mockReturnValue(mockInnerInvocation);
|
||||
});
|
||||
|
||||
it('should have Kind.Agent', () => {
|
||||
const tool = new SubagentTool(testDefinition, mockConfig, mockMessageBus);
|
||||
expect(tool.kind).toBe(Kind.Agent);
|
||||
});
|
||||
|
||||
it('should delegate shouldConfirmExecute to the inner sub-invocation (local)', async () => {
|
||||
const tool = new SubagentTool(testDefinition, mockConfig, mockMessageBus);
|
||||
const params = {};
|
||||
|
||||
@@ -41,7 +41,7 @@ export class SubagentTool extends BaseDeclarativeTool<AgentInputs, ToolResult> {
|
||||
definition.name,
|
||||
definition.displayName ?? definition.name,
|
||||
definition.description,
|
||||
Kind.Think,
|
||||
Kind.Agent,
|
||||
inputSchema,
|
||||
messageBus,
|
||||
/* isOutputMarkdown */ true,
|
||||
|
||||
@@ -832,6 +832,7 @@ export enum Kind {
|
||||
Search = 'search',
|
||||
Execute = 'execute',
|
||||
Think = 'think',
|
||||
Agent = 'agent',
|
||||
Fetch = 'fetch',
|
||||
Communicate = 'communicate',
|
||||
Plan = 'plan',
|
||||
|
||||
Reference in New Issue
Block a user