refactor(agents): hide compaction timeout internals · openclaw/openclaw@71fbddd
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,10 +4,11 @@ import type { CompactResult, ContextEngine } from "../context-engine/types.js";
|
4 | 4 | import { |
5 | 5 | compactContextEngineWithSafetyTimeout, |
6 | 6 | compactWithSafetyTimeout, |
7 | | -EMBEDDED_COMPACTION_TIMEOUT_MS, |
8 | 7 | resolveCompactionTimeoutMs, |
9 | 8 | } from "./embedded-agent-runner/compaction-safety-timeout.js"; |
10 | 9 | |
| 10 | +const EMBEDDED_COMPACTION_TIMEOUT_MS = 180_000; |
| 11 | + |
11 | 12 | describe("compactWithSafetyTimeout", () => { |
12 | 13 | beforeEach(() => { |
13 | 14 | vi.useRealTimers(); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,7 +6,7 @@ import type { OpenClawConfig } from "../../config/types.openclaw.js";
|
6 | 6 | import type { CompactResult, ContextEngine } from "../../context-engine/types.js"; |
7 | 7 | import { withTimeout } from "../../node-host/with-timeout.js"; |
8 | 8 | |
9 | | -export const EMBEDDED_COMPACTION_TIMEOUT_MS = 180_000; |
| 9 | +const EMBEDDED_COMPACTION_TIMEOUT_MS = 180_000; |
10 | 10 | |
11 | 11 | function createAbortError(signal: AbortSignal): Error { |
12 | 12 | const reason = "reason" in signal ? signal.reason : undefined; |
@@ -137,7 +137,7 @@ export async function compactWithSafetyTimeout<T>(
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** Parameters for a single {@link ContextEngine.compact} invocation. */ |
140 | | -export type ContextEngineCompactParams = Parameters<ContextEngine["compact"]>[0]; |
| 140 | +type ContextEngineCompactParams = Parameters<ContextEngine["compact"]>[0]; |
141 | 141 | |
142 | 142 | /** |
143 | 143 | * Invoke a plugin-owned {@link ContextEngine.compact} bounded by the same |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。