mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 12:26:38 -06:00
fix: treat aborted subagent lifecycle events as killed
This commit is contained in:
@@ -1008,6 +1008,7 @@ describe("subagent registry seam flow", () => {
|
||||
phase: "end",
|
||||
startedAt: 10,
|
||||
endedAt: 20,
|
||||
aborted: true,
|
||||
stopReason: "aborted",
|
||||
},
|
||||
});
|
||||
@@ -1037,6 +1038,9 @@ describe("subagent registry seam flow", () => {
|
||||
.find((entry) => entry.runId === "run-aborted-end");
|
||||
expect(run?.endedReason).toBe("subagent-killed");
|
||||
expect(run?.outcome?.status).toBe("error");
|
||||
|
||||
await vi.advanceTimersByTimeAsync(20_000);
|
||||
expect(mocks.runSubagentAnnounceFlow).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("preserves run-mode keep entries past SESSION_RUN_TTL_MS sweep", async () => {
|
||||
|
||||
@@ -1016,13 +1016,6 @@ function ensureListener() {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (evt.data?.aborted) {
|
||||
schedulePendingLifecycleTimeout({
|
||||
runId: evt.runId,
|
||||
endedAt,
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (isAbortedAgentStopReason(stopReason)) {
|
||||
clearPendingLifecycleError(evt.runId);
|
||||
clearPendingLifecycleTimeout(evt.runId);
|
||||
@@ -1040,6 +1033,13 @@ function ensureListener() {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (evt.data?.aborted) {
|
||||
schedulePendingLifecycleTimeout({
|
||||
runId: evt.runId,
|
||||
endedAt,
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (evt.data?.yielded === true) {
|
||||
if (
|
||||
markSubagentRunPausedAfterYield({
|
||||
|
||||
Reference in New Issue
Block a user