fix(clawsweeper): address review for gitcrawl-1599-fix-register-abortcontroller-for-agent-rpc-runs-so-chat-abort-wo (validation-1)

This commit is contained in:
clawsweeper
2026-06-05 09:43:48 +00:00
parent 7c9cf51c6f
commit 9f337848ba
3 changed files with 9 additions and 8 deletions

View File

@@ -269,13 +269,13 @@ function chatRunWatchdogResultIsTerminal(
if (status !== "timeout" && status !== "timed_out") {
return true;
}
return Boolean(
return (
result?.endedAt != null ||
result?.error != null ||
result?.stopReason != null ||
result?.livenessState != null ||
result?.yielded === true ||
result?.pendingError === true,
result?.error != null ||
result?.stopReason != null ||
result?.livenessState != null ||
result?.yielded === true ||
result?.pendingError === true
);
}

View File

@@ -26,7 +26,7 @@ function createHost() {
chatMessages: [],
chatToolMessages: [],
chatStream: null,
chatRunId: null,
chatRunId: null as string | null,
chatRunLastActivityAt: null as number | null,
chatRunWatchdogTimer: null as ReturnType<typeof globalThis.setTimeout> | number | null,
chatRunWatchdogProbeInFlight: false,

View File

@@ -2164,6 +2164,7 @@ describe("chat run watchdog", () => {
toolStreamOrder: [],
chatToolMessages: [],
chatStreamSegments: [],
updateComplete: Promise.resolve(),
basePath: "",
settings: {
gatewayUrl: "ws://gateway.test/control",
@@ -2212,7 +2213,7 @@ describe("chat run watchdog", () => {
});
expect(request).toHaveBeenCalledWith(
"chat.history",
expect.objectContaining({ sessionKey: "main", limit: 200 }),
expect.objectContaining({ sessionKey: "main", limit: 100 }),
);
expect(request).toHaveBeenCalledWith(
"chat.send",