refactor(agents): hide compaction reconcile wrapper · openclaw/openclaw@599abac
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,7 @@
|
4 | 4 | import { resolveStorePath, updateSessionStoreEntry } from "../config/sessions.js"; |
5 | 5 | |
6 | 6 | /** Persist the highest observed compaction count after a successful subscribed run. */ |
7 | | -export async function reconcileSessionStoreCompactionCountAfterSuccess(params: { |
| 7 | +export default async function reconcileSessionStoreCompactionCountAfterSuccess(params: { |
8 | 8 | sessionKey?: string; |
9 | 9 | agentId?: string; |
10 | 10 | configStore?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -13,8 +13,8 @@ import {
|
13 | 13 | import { |
14 | 14 | handleCompactionEnd, |
15 | 15 | handleCompactionStart, |
16 | | -reconcileSessionStoreCompactionCountAfterSuccess, |
17 | 16 | } from "./embedded-agent-subscribe.handlers.compaction.js"; |
| 17 | +import reconcileSessionStoreCompactionCountAfterSuccess from "./embedded-agent-subscribe.handlers.compaction.runtime.js"; |
18 | 18 | import type { EmbeddedAgentSubscribeContext } from "./embedded-agent-subscribe.handlers.types.js"; |
19 | 19 | import type { AgentMessage } from "./runtime/index.js"; |
20 | 20 | import { makeZeroUsageSnapshot, type AssistantUsageSnapshot } from "./usage.js"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -180,15 +180,16 @@ export function handleCompactionEnd(ctx: EmbeddedAgentSubscribeContext, evt: Com
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** Lazily reconciles persisted compaction count after a successful compaction. */ |
183 | | -export async function reconcileSessionStoreCompactionCountAfterSuccess(params: { |
| 183 | +async function reconcileSessionStoreCompactionCountAfterSuccess(params: { |
184 | 184 | sessionKey?: string; |
185 | 185 | agentId?: string; |
186 | 186 | configStore?: string; |
187 | 187 | observedCompactionCount: number; |
188 | 188 | now?: number; |
189 | 189 | }): Promise<number | undefined> { |
190 | | -const { reconcileSessionStoreCompactionCountAfterSuccess: reconcile } = |
191 | | -await import("./embedded-agent-subscribe.handlers.compaction.runtime.js"); |
| 190 | +const { default: reconcile } = await import( |
| 191 | +"./embedded-agent-subscribe.handlers.compaction.runtime.js" |
| 192 | +); |
192 | 193 | return reconcile(params); |
193 | 194 | } |
194 | 195 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。