Compare commits

...
Author SHA1 Message Date
John Simone 04c1473c87 add safety checks to prevent crash 2026-06-29 08:04:23 -07:00
3 changed files with 19 additions and 2 deletions
+10
View File
@@ -53,6 +53,16 @@ if (!isMainThread) {
promise.catch(() => {});
return;
}
// AgentRuntimeAbortError can leak from streaming LLM or hub
// capability teardown after the abort grace window expires.
// Treat it as a non-fatal side-effect of an abort.
if (
reason instanceof Error &&
reason.name === "AgentRuntimeAbortError"
) {
promise.catch(() => {});
return;
}
handleFatalProcessError("unhandledRejection", reason);
});
+1 -1
View File
@@ -75,7 +75,7 @@ export function clearAbortInProgress(): void {
}
savedRejectionListeners = undefined;
}
}, 2000);
}, 5000);
}
export function isAbortInProgress(): boolean {
@@ -279,7 +279,14 @@ export function createInteractiveSessionRuntime(input: {
if (!sessionManager || !activeSessionId) {
return [];
}
return (await sessionManager.readMessages(activeSessionId)) ?? [];
try {
return (await sessionManager.readMessages(activeSessionId)) ?? [];
} catch (error) {
if (isSessionNotFoundError(error)) {
return [];
}
throw error;
}
};
const recoverMissingActiveSession = async (error: unknown): Promise<void> => {