|
8 | 8 | type EmbeddedAgentCompactResult, |
9 | 9 | } from "openclaw/plugin-sdk/agent-harness-runtime"; |
10 | 10 | import { resolveAgentDir, resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-runtime"; |
| 11 | +import { createDedupeCache } from "openclaw/plugin-sdk/dedupe-runtime"; |
11 | 12 | import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue"; |
12 | 13 | import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime"; |
13 | 14 | import { isIncognitoSessionKey } from "../incognito-session.js"; |
@@ -42,7 +43,9 @@ import { |
42 | 43 | } from "./shared-client.js"; |
43 | 44 | import { resumeCodexAppServerThread } from "./thread-resume.js"; |
44 | 45 |
|
45 | | -const warnedIgnoredCompactionOverrides = new Set<string>(); |
| 46 | +// ttlMs: 0 retains keys until the 4,096-entry LRU cap evicts them, after which a |
| 47 | +// previously suppressed warning can intentionally emit again. |
| 48 | +const warnedIgnoredCompactionOverrides = createDedupeCache({ ttlMs: 0, maxSize: 4096 }); |
46 | 49 | const codexNativeCompactionQueue = new KeyedAsyncQueue(); |
47 | 50 | const CODEX_NATIVE_COMPACTION_INTERRUPT_GRACE_MS = 30_000; |
48 | 51 | type CodexAppServerCompactOptions = { |
@@ -350,10 +353,9 @@ function warnIfIgnoringOpenClawCompactionOverrides( |
350 | 353 | return; |
351 | 354 | } |
352 | 355 | const warningKey = ignoredConfig.join("\0"); |
353 | | - if (warnedIgnoredCompactionOverrides.has(warningKey)) { |
| 356 | + if (warnedIgnoredCompactionOverrides.check(warningKey)) { |
354 | 357 | return; |
355 | 358 | } |
356 | | - warnedIgnoredCompactionOverrides.add(warningKey); |
357 | 359 | embeddedAgentLog.warn( |
358 | 360 | "ignoring OpenClaw compaction overrides for Codex app-server compaction; Codex uses native server-side compaction", |
359 | 361 | { |
|
0 commit comments