fix: report subagent timeout as 'timed out' instead of 'completed successfully' (#13996)

* fix: report subagent timeout as 'timed out' instead of 'completed successfully'

* fix: propagate subagent timeout status across agent.wait (#13996) (thanks @dario-github)

---------

Co-authored-by: Sebastian <19554889+sebslight@users.noreply.github.com>
This commit is contained in:
Dario Zhang
2026-02-12 01:55:30 +08:00
committed by GitHub
parent 2c6569a488
commit e85bbe01f2
5 changed files with 122 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ let agentRunListenerStarted = false;
type AgentRunSnapshot = {
runId: string;
status: "ok" | "error";
status: "ok" | "error" | "timeout";
startedAt?: number;
endedAt?: number;
error?: string;
@@ -55,7 +55,7 @@ function ensureAgentRunListener() {
agentRunStarts.delete(evt.runId);
recordAgentRunSnapshot({
runId: evt.runId,
status: phase === "error" ? "error" : "ok",
status: phase === "error" ? "error" : evt.data?.aborted ? "timeout" : "ok",
startedAt,
endedAt,
error,
@@ -118,7 +118,7 @@ export async function waitForAgentJob(params: {
const error = typeof evt.data?.error === "string" ? evt.data.error : undefined;
const snapshot: AgentRunSnapshot = {
runId: evt.runId,
status: phase === "error" ? "error" : "ok",
status: phase === "error" ? "error" : evt.data?.aborted ? "timeout" : "ok",
startedAt,
endedAt,
error,