Files
openclaw/src/agents/context.opencode-go.test.ts
kumaxs 356385045f fix(opencode-go): warm context metadata from provider catalog (#92913)
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>
2026-06-14 12:08:49 -07:00

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();
});
});