mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 09:31:41 +00:00
fix(agents): avoid synthetic tool-result writes on idle-timeout cleanup
This commit is contained in:
@@ -9,6 +9,8 @@ import { installSessionToolResultGuard } from "./session-tool-result-guard.js";
|
||||
export type GuardedSessionManager = SessionManager & {
|
||||
/** Flush any synthetic tool results for pending tool calls. Idempotent. */
|
||||
flushPendingToolResults?: () => void;
|
||||
/** Clear pending tool calls without persisting synthetic tool results. Idempotent. */
|
||||
clearPendingToolResults?: () => void;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -69,5 +71,6 @@ export function guardSessionManager(
|
||||
beforeMessageWriteHook: beforeMessageWrite,
|
||||
});
|
||||
(sessionManager as GuardedSessionManager).flushPendingToolResults = guard.flushPendingToolResults;
|
||||
(sessionManager as GuardedSessionManager).clearPendingToolResults = guard.clearPendingToolResults;
|
||||
return sessionManager as GuardedSessionManager;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user