mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 19:14:58 +00:00
Compaction: count only completed auto-compactions (#24056)
* Compaction: count only completed auto-compactions * Compaction: count only non-retry completions * Changelog: note completed-only compaction counting * Agents/Compaction: guard optional compaction increment
This commit is contained in:
@@ -5,7 +5,6 @@ import type { EmbeddedPiSubscribeContext } from "./pi-embedded-subscribe.handler
|
||||
|
||||
export function handleAutoCompactionStart(ctx: EmbeddedPiSubscribeContext) {
|
||||
ctx.state.compactionInFlight = true;
|
||||
ctx.incrementCompactionCount();
|
||||
ctx.ensureCompactionPromise();
|
||||
ctx.log.debug(`embedded run compaction start: runId=${ctx.params.runId}`);
|
||||
emitAgentEvent({
|
||||
@@ -40,6 +39,9 @@ export function handleAutoCompactionEnd(
|
||||
) {
|
||||
ctx.state.compactionInFlight = false;
|
||||
const willRetry = Boolean(evt.willRetry);
|
||||
if (!willRetry) {
|
||||
ctx.incrementCompactionCount?.();
|
||||
}
|
||||
if (willRetry) {
|
||||
ctx.noteCompactionRetry();
|
||||
ctx.resetForCompactionRetry();
|
||||
|
||||
Reference in New Issue
Block a user