mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-16 20:17:56 +00:00
fix: only fire after_compaction hook on successful compaction
Match legacy path semantics: compactEmbeddedPiSessionDirect only reaches the after_compaction hook after session.compact() succeeds. Gate the engine-owned path on result.ok && result.compacted so subscribers don't receive after_compaction for failed compactions.
This commit is contained in:
committed by
Josh Lehman
parent
054ded7b02
commit
c0e451e418
@@ -981,7 +981,7 @@ export async function compactEmbeddedPiSession(
|
||||
force: params.trigger === "manual",
|
||||
runtimeContext: params as Record<string, unknown>,
|
||||
});
|
||||
if (hookRunner?.hasHooks("after_compaction")) {
|
||||
if (result.ok && result.compacted && hookRunner?.hasHooks("after_compaction")) {
|
||||
try {
|
||||
await hookRunner.runAfterCompaction(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user