fix(core): accurately reflect subagent tool failure in UI (#23187)

This commit is contained in:
Abhi
2026-03-23 21:56:00 -04:00
committed by GitHub
parent 89ca78837e
commit a1f9af3fa7
8 changed files with 91 additions and 5 deletions
@@ -30,6 +30,7 @@ import {
type SubagentActivityEvent,
type SubagentProgress,
type SubagentActivityItem,
isToolActivityError,
} from '../types.js';
import type { MessageBus } from '../../confirmation-bus/message-bus.js';
import {
@@ -210,8 +211,9 @@ export class BrowserAgentInvocation extends BaseToolInvocation<
const callId = activity.data['id']
? String(activity.data['id'])
: undefined;
// Find the tool call by ID
// Find the tool call by ID
const data = activity.data['data'];
const isError = isToolActivityError(data);
for (let i = recentActivity.length - 1; i >= 0; i--) {
if (
recentActivity[i].type === 'tool_call' &&
@@ -219,7 +221,7 @@ export class BrowserAgentInvocation extends BaseToolInvocation<
recentActivity[i].id === callId &&
recentActivity[i].status === 'running'
) {
recentActivity[i].status = 'completed';
recentActivity[i].status = isError ? 'error' : 'completed';
updated = true;
break;
}