Skip to content

Commit 02b6b6c

Browse files
fix(cron): route CLI-runtime cron models through compatible backend
Co-authored-by: vishutdhar <68405187+vishutdhar@users.noreply.github.com>
1 parent c8ab229 commit 02b6b6c

3 files changed

Lines changed: 48 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Docs: https://docs.openclaw.ai
5555
- Gateway: avoid repeated plugin tool descriptor config hashing so large runtime configs do not block reply startup and trigger reconnect/timeouts. (#75944) Thanks @joshavant.
5656
- Plugins/externalization: keep diagnostics ClawHub packages and persisted bundled-plugin relocation on npm-first install metadata for launch, and omit Discord from the core package now that its external package is published. Thanks @vincentkoc.
5757
- Setup/TUI: bound the Terminal hatch bootstrap run so a stalled provider request times out instead of leaving first-run hatching stuck behind the watchdog. (#76241) Thanks @joshavant.
58+
- Cron/CLI runtimes: route isolated cron jobs through configured CLI runtimes only when the resolved model provider is compatible, so OpenAI job overrides no longer inherit a mismatched Claude CLI backend. Thanks @vishutdhar.
5859
- Plugins/Codex: allow the official npm Codex plugin to install without the unsafe-install override, keep `/codex` command ownership, and cover the real npm Docker live path through managed `.openclaw/npm` dependencies plus uninstall failure proof.
5960
- Gateway/status: add concrete service, config, listener-owner, and log collection next steps when gateway probes fail and Bonjour finds no local gateway, so frozen or port-conflict reports include the data needed for root-cause triage. Refs #49012. Thanks @vincentkoc.
6061
- Codex harness: forward OpenClaw workspace bootstrap files such as `SOUL.md` through native Codex config instructions while leaving `AGENTS.md` to Codex project-doc discovery. Fixes #76273. Thanks @zknicker.

src/cron/isolated-agent.model-formatting.test.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,45 @@ describe("cron model formatting and precedence edge cases", () => {
401401
});
402402
});
403403

404+
describe("CLI runtime compatibility", () => {
405+
it("uses a configured Claude CLI runtime for resolved Anthropic models", async () => {
406+
await expectSelectedModel(
407+
{
408+
cfg: {
409+
agents: {
410+
defaults: {
411+
model: "anthropic/claude-opus-4-6",
412+
agentRuntime: { id: "claude-cli" },
413+
},
414+
},
415+
},
416+
},
417+
{ provider: "claude-cli", model: "claude-opus-4-6" },
418+
);
419+
});
420+
421+
it("keeps an OpenAI payload override on OpenAI when Claude CLI is configured", async () => {
422+
await expectSelectedModel(
423+
{
424+
cfg: {
425+
agents: {
426+
defaults: {
427+
model: "anthropic/claude-opus-4-6",
428+
agentRuntime: { id: "claude-cli" },
429+
},
430+
},
431+
},
432+
payload: {
433+
kind: "agentTurn",
434+
message: DEFAULT_MESSAGE,
435+
model: "openai/gpt-4.1-mini",
436+
},
437+
},
438+
{ provider: "openai", model: "gpt-4.1-mini" },
439+
);
440+
});
441+
});
442+
404443
describe("stored session overrides", () => {
405444
it("stored modelOverride/providerOverride are applied", async () => {
406445
await expectSelectedModel(

src/cron/isolated-agent/model-selection.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { resolveCliRuntimeExecutionProvider } from "../../agents/model-runtime-aliases.js";
12
import type { OpenClawConfig } from "../../config/types.openclaw.js";
23
import type { CronJob } from "../types.js";
34
import {
@@ -147,5 +148,11 @@ export async function resolveCronModelSelection(
147148
}
148149
}
149150

150-
return { ok: true, provider, model };
151+
const executionProvider =
152+
resolveCliRuntimeExecutionProvider({
153+
provider,
154+
cfg: params.cfgWithAgentDefaults,
155+
}) ?? provider;
156+
157+
return { ok: true, provider: executionProvider, model };
151158
}

0 commit comments

Comments
 (0)