mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-27 08:09:35 +00:00
refactor(agents): hide compaction timeout internals
This commit is contained in:
@@ -4,10 +4,11 @@ import type { CompactResult, ContextEngine } from "../context-engine/types.js";
|
||||
import {
|
||||
compactContextEngineWithSafetyTimeout,
|
||||
compactWithSafetyTimeout,
|
||||
EMBEDDED_COMPACTION_TIMEOUT_MS,
|
||||
resolveCompactionTimeoutMs,
|
||||
} from "./embedded-agent-runner/compaction-safety-timeout.js";
|
||||
|
||||
const EMBEDDED_COMPACTION_TIMEOUT_MS = 180_000;
|
||||
|
||||
describe("compactWithSafetyTimeout", () => {
|
||||
beforeEach(() => {
|
||||
vi.useRealTimers();
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { OpenClawConfig } from "../../config/types.openclaw.js";
|
||||
import type { CompactResult, ContextEngine } from "../../context-engine/types.js";
|
||||
import { withTimeout } from "../../node-host/with-timeout.js";
|
||||
|
||||
export const EMBEDDED_COMPACTION_TIMEOUT_MS = 180_000;
|
||||
const EMBEDDED_COMPACTION_TIMEOUT_MS = 180_000;
|
||||
|
||||
function createAbortError(signal: AbortSignal): Error {
|
||||
const reason = "reason" in signal ? signal.reason : undefined;
|
||||
@@ -137,7 +137,7 @@ export async function compactWithSafetyTimeout<T>(
|
||||
}
|
||||
|
||||
/** Parameters for a single {@link ContextEngine.compact} invocation. */
|
||||
export type ContextEngineCompactParams = Parameters<ContextEngine["compact"]>[0];
|
||||
type ContextEngineCompactParams = Parameters<ContextEngine["compact"]>[0];
|
||||
|
||||
/**
|
||||
* Invoke a plugin-owned {@link ContextEngine.compact} bounded by the same
|
||||
|
||||
Reference in New Issue
Block a user