mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-23 01:18:11 +00:00
Register OpenCode Go's provider-owned static catalog so lifecycle cache warmup supplies the correct context window to memory flush and compaction without persisting catalog rows in user config. Fixes #92912. Co-authored-by: kumaxs <45620232+kumaxs@users.noreply.github.com>
26 lines
817 B
TypeScript
26 lines
817 B
TypeScript
import { afterEach, describe, expect, it } from "vitest";
|
|
import { resolveMemoryFlushContextWindowTokens } from "../auto-reply/reply/memory-flush.js";
|
|
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
|
import { refreshContextWindowCache, resetContextWindowCacheForTest } from "./context.js";
|
|
|
|
describe("OpenCode Go context metadata", () => {
|
|
afterEach(() => {
|
|
resetContextWindowCacheForTest();
|
|
});
|
|
|
|
it("warms the provider-owned context window without writing model config", async () => {
|
|
const cfg: OpenClawConfig = {};
|
|
|
|
await refreshContextWindowCache(cfg);
|
|
|
|
expect(
|
|
resolveMemoryFlushContextWindowTokens({
|
|
cfg,
|
|
provider: "opencode-go",
|
|
modelId: "deepseek-v4-pro",
|
|
}),
|
|
).toBe(1_000_000);
|
|
expect(cfg.models).toBeUndefined();
|
|
});
|
|
});
|