mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 17:08:27 +00:00
fix: add safety timeout to session.compact() to prevent lane deadlock (#16533)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 21e4045add
Co-authored-by: BinHPdev <219093083+BinHPdev@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
10
src/agents/pi-embedded-runner/compaction-safety-timeout.ts
Normal file
10
src/agents/pi-embedded-runner/compaction-safety-timeout.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { withTimeout } from "../../node-host/with-timeout.js";
|
||||
|
||||
export const EMBEDDED_COMPACTION_TIMEOUT_MS = 300_000;
|
||||
|
||||
export async function compactWithSafetyTimeout<T>(
|
||||
compact: () => Promise<T>,
|
||||
timeoutMs: number = EMBEDDED_COMPACTION_TIMEOUT_MS,
|
||||
): Promise<T> {
|
||||
return await withTimeout(() => compact(), timeoutMs, "Compaction");
|
||||
}
|
||||
Reference in New Issue
Block a user