mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-19 17:50:37 -07:00
feat(core): refactor subagent tool to unified invoke_subagent tool (#24489)
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
CoreToolCallStatus,
|
||||
type SubagentActivityItem,
|
||||
type SubagentActivityMessage,
|
||||
AGENT_TOOL_NAME,
|
||||
} from '@google/gemini-cli-core';
|
||||
import { useCallback, useState, useMemo, useEffect, useRef } from 'react';
|
||||
|
||||
@@ -253,7 +254,7 @@ export function useToolScheduler(
|
||||
const flattened = Object.values(toolCallsMap).flat();
|
||||
return flattened.map((tc) => {
|
||||
let subagentName = tc.request.name;
|
||||
if (tc.request.name === 'invoke_subagent') {
|
||||
if (tc.request.name === AGENT_TOOL_NAME) {
|
||||
const argsObj = tc.request.args;
|
||||
let parsedArgs: unknown = argsObj;
|
||||
|
||||
@@ -267,7 +268,7 @@ export function useToolScheduler(
|
||||
|
||||
if (typeof parsedArgs === 'object' && parsedArgs !== null) {
|
||||
for (const [key, value] of Object.entries(parsedArgs)) {
|
||||
if (key === 'subagent_name' && typeof value === 'string') {
|
||||
if (key === 'agent_name' && typeof value === 'string') {
|
||||
subagentName = value;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user