mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:28:26 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user