feat(core): refactor subagent tool to unified invoke_subagent tool (#24489)

This commit is contained in:
Abhi
2026-04-09 12:48:24 -04:00
committed by GitHub
parent 6686c8ee4c
commit b238a453e3
47 changed files with 1051 additions and 467 deletions
@@ -54,7 +54,9 @@ describe('browser-agent-localhost', () => {
const toolLogs = rig.readToolLogs();
const browserAgentCall = toolLogs.find(
(t) => t.toolRequest.name === 'browser_agent',
(t) =>
t.toolRequest.name === 'invoke_agent' &&
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
);
expect(
browserAgentCall,
@@ -79,7 +81,9 @@ describe('browser-agent-localhost', () => {
const toolLogs = rig.readToolLogs();
const browserAgentCall = toolLogs.find(
(t) => t.toolRequest.name === 'browser_agent',
(t) =>
t.toolRequest.name === 'invoke_agent' &&
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
);
expect(
browserAgentCall,
@@ -104,7 +108,9 @@ describe('browser-agent-localhost', () => {
const toolLogs = rig.readToolLogs();
const browserAgentCall = toolLogs.find(
(t) => t.toolRequest.name === 'browser_agent',
(t) =>
t.toolRequest.name === 'invoke_agent' &&
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
);
expect(
browserAgentCall,
@@ -129,7 +135,9 @@ describe('browser-agent-localhost', () => {
const toolLogs = rig.readToolLogs();
const browserAgentCall = toolLogs.find(
(t) => t.toolRequest.name === 'browser_agent',
(t) =>
t.toolRequest.name === 'invoke_agent' &&
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
);
expect(
browserAgentCall,
@@ -154,7 +162,9 @@ describe('browser-agent-localhost', () => {
const toolLogs = rig.readToolLogs();
const browserCalls = toolLogs.filter(
(t) => t.toolRequest.name === 'browser_agent',
(t) =>
t.toolRequest.name === 'invoke_agent' &&
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
);
expect(browserCalls.length).toBeGreaterThan(0);
});