Skip to content

The agent that grows with you

fix(desktop): widen terminal-status handling to sibling sites

Teknium1c80085f04cc
diff --git a/apps/desktop/src/components/assistant-ui/tool/delegate-model.test.ts b/apps/desktop/src/components/assistant-ui/tool/delegate-model.test.ts
index 975ad90627b..14882cdf73e 100644
--- a/apps/desktop/src/components/assistant-ui/tool/delegate-model.test.ts
+++ b/apps/desktop/src/components/assistant-ui/tool/delegate-model.test.ts
@@ -53,6 +53,25 @@ describe('delegateRowsFromCall', () => {
expect(rows[0]).toMatchObject({ activity: ['found it'], durationSeconds: 12, model: 'anthropic/claude-opus-5' })
})
+ // #73728 / #85492: the delegate tool settles rows with 'ok', 'error' or
+ // 'timeout' — anything that is not a success must render as failed instead
+ // of hiding behind a green 'completed' check.
+ it('renders timeout/error settled results as failed, ok as completed', () => {
+ const rows = delegateRowsFromCall(
+ { tasks: [{ goal: 'A' }, { goal: 'B' }, { goal: 'C' }, { goal: 'D' }] },
+ {
+ results: [
+ { status: 'ok', summary: 'done' },
+ { status: 'timeout', error: 'Timed out after 600s' },
+ { status: 'error', error: 'boom' },
+ { status: 'failure' }
+ ]
+ }
+ )
+
+ expect(rows.map(r => r.status)).toEqual(['completed', 'failed', 'failed', 'failed'])
+ })
+
it('still lists a background dispatch whose goals only survive in the result', () => {
expect(delegateRowsFromCall({}, { status: 'dispatched', goals: ['A', 'B'] }).map(r => r.goal)).toEqual(['A', 'B'])
})
diff --git a/apps/desktop/src/components/assistant-ui/tool/delegate-model.ts b/apps/desktop/src/components/assistant-ui/tool/delegate-model.ts
index 7f1c4b48d07..eff61ec17d4 100644
--- a/apps/desktop/src/components/assistant-ui/tool/delegate-model.ts
+++ b/apps/desktop/src/components/assistant-ui/tool/delegate-model.ts
@@ -52,6 +52,14 @@ function resultRows(result: unknown): Record<string, unknown>[] {
return results.map(parseMaybeObject)
}
+// The delegate tool settles result rows with statuses like 'ok', 'error',
+// 'timeout', 'failed'/'failure' (tools/delegate_tool.py). Anything that is
+// not a success must render as failed — mapping unknown statuses to
+// 'completed' hid timed-out children behind a green check (#73728, #85492).
+function settledRowStatus(status: string): DelegateRowStatus {
+ return status === '' || status === 'ok' || status === 'completed' ? 'completed' : 'failed'
+}
+
function dispatchedGoals(result: unknown): string[] {
const record = parseMaybeObject(result)
@@ -87,7 +95,7 @@ export function delegateRowsFromCall(args: unknown, result: unknown, toolCallId
goal,
id: `${toolCallId}:${index}`,
model: entry ? field(entry, 'model') || undefined : undefined,
- status: entry ? (field(entry, 'status') === 'failed' ? 'failed' : 'completed') : idle
+ status: entry ? settledRowStatus(field(entry, 'status')) : idle
}
})
}
diff --git a/apps/desktop/src/store/subagents.ts b/apps/desktop/src/store/subagents.ts
index 3f7b15bbce1..7196f14a471 100644
--- a/apps/desktop/src/store/subagents.ts
+++ b/apps/desktop/src/store/subagents.ts
@@ -56,7 +56,7 @@ const num = (v: unknown) => (typeof v === 'number' && Number.isFinite(v) ? v : u
const strList = (v: unknown) => (Array.isArray(v) ? v.filter(isStr) : [])
const asStatus = (v: unknown, terminalEvent = false): SubagentStatus => {
- if (v === 'completed' || v === 'failed' || v === 'interrupted' || v === 'queued') {
+ if (v === 'completed' || v === 'failed' || v === 'interrupted') {
return v
}
@@ -69,14 +69,14 @@ const asStatus = (v: unknown, terminalEvent = false): SubagentStatus => {
}
// Fail closed on completion: a subagent.complete event is terminal by
- // definition, so an unrecognized status must render as a failure rather
- // than leave a dead row spinning as 'running' forever. Live events keep
- // the lenient 'running' fallback.
+ // definition, so an unrecognized (or still-active 'queued'/'running')
+ // status must render as a failure rather than leave a dead row spinning
+ // as 'running' forever. Live events keep the lenient fallback.
if (terminalEvent) {
return 'failed'
}
- return 'running'
+ return v === 'queued' ? v : 'running'
}
const compact = (text: string, max = PREVIEW_MAX) => {