mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-16 11:41:08 +00:00
fix: address Codex harness review regressions
This commit is contained in:
@@ -63,7 +63,8 @@ async function prewarmConfiguredPrimaryModel(params: {
|
||||
if (isCliProvider(provider, params.cfg)) {
|
||||
return;
|
||||
}
|
||||
if (resolveEmbeddedAgentRuntime() !== "auto") {
|
||||
const runtime = resolveEmbeddedAgentRuntime();
|
||||
if (runtime !== "auto" && runtime !== "pi") {
|
||||
return;
|
||||
}
|
||||
if (selectAgentHarness({ provider, modelId: model }).id !== "pi") {
|
||||
|
||||
@@ -167,4 +167,29 @@ describe("gateway startup primary model warmup", () => {
|
||||
expect(ensureOpenClawModelsJsonMock).not.toHaveBeenCalled();
|
||||
expect(resolveModelMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("keeps PI static warmup when the PI agent runtime is forced", async () => {
|
||||
resolveEmbeddedAgentRuntimeMock.mockReturnValue("pi");
|
||||
const cfg = {
|
||||
agents: {
|
||||
defaults: {
|
||||
model: {
|
||||
primary: "openai-codex/gpt-5.4",
|
||||
},
|
||||
},
|
||||
},
|
||||
} as OpenClawConfig;
|
||||
|
||||
await prewarmConfiguredPrimaryModel({
|
||||
cfg,
|
||||
log: { warn: vi.fn() },
|
||||
});
|
||||
|
||||
expect(selectAgentHarnessMock).toHaveBeenCalledWith({
|
||||
provider: "openai-codex",
|
||||
modelId: "gpt-5.4",
|
||||
});
|
||||
expect(ensureOpenClawModelsJsonMock).toHaveBeenCalledWith(cfg, "/tmp/agent");
|
||||
expect(resolveModelMock).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user