fix(cron): show rejected model allowlist · openclaw/openclaw@139122f
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -154,6 +154,7 @@ Docs: https://docs.openclaw.ai
|
154 | 154 | |
155 | 155 | ### Fixes |
156 | 156 | |
| 157 | +- Cron: make rejected `payload.model` errors show the configured `agents.defaults.models` allowlist instead of echoing the rejected model twice. Fixes #79058. |
157 | 158 | - Agents/subagents: retry parent wake announces when the announce-summary model run fails with fallback cooldown exhaustion instead of dropping the wake on the first transient provider overload. Refs #78581. |
158 | 159 | - Providers/network: honor IPv4 CIDR and octet-wildcard `NO_PROXY` entries such as `100.64.0.0/10` and `100.64.*` before enabling trusted env-proxy mode for model-provider requests. Fixes #79030. |
159 | 160 | - Docs/Docker: document a local Compose override for Docker Desktop DNS failures in the shared-network `openclaw-cli` sidecar, keeping the default compose setup hardened while unblocking `openclaw plugins install` when users opt in. Fixes #79018. Thanks @Jason-Vaughan. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -42,10 +42,23 @@ export type ResolveCronModelSelectionResult =
|
42 | 42 | error: string; |
43 | 43 | }; |
44 | 44 | |
45 | | -function formatCronPayloadModelRejection(modelOverride: string, error: string): string { |
| 45 | +function formatAllowedModelRefs(params: { cfg: OpenClawConfig }): string { |
| 46 | +const configured = params.cfg.agents?.defaults?.models; |
| 47 | +if (configured && typeof configured === "object" && Object.keys(configured).length > 0) { |
| 48 | +return Object.keys(configured).sort().join(", "); |
| 49 | +} |
| 50 | +return "(none configured)"; |
| 51 | +} |
| 52 | + |
| 53 | +function formatCronPayloadModelRejection(params: { |
| 54 | +cfg: OpenClawConfig; |
| 55 | +modelOverride: string; |
| 56 | +error: string; |
| 57 | +}): string { |
| 58 | +const { modelOverride, error } = params; |
46 | 59 | if (error.startsWith("model not allowed:")) { |
47 | 60 | const modelRef = error.slice("model not allowed:".length).trim(); |
48 | | -return `cron payload.model '${modelOverride}' rejected by agents.defaults.models allowlist: ${modelRef}`; |
| 61 | +return `cron payload.model '${modelOverride}' rejected by agents.defaults.models allowlist: ${modelRef} is not in [${formatAllowedModelRefs({ cfg: params.cfg })}]`; |
49 | 62 | } |
50 | 63 | return `cron payload.model '${modelOverride}' rejected: ${error}`; |
51 | 64 | } |
@@ -122,7 +135,11 @@ export async function resolveCronModelSelection(
|
122 | 135 | if ("error" in resolvedOverride) { |
123 | 136 | return { |
124 | 137 | ok: false, |
125 | | -error: formatCronPayloadModelRejection(modelOverride, resolvedOverride.error), |
| 138 | +error: formatCronPayloadModelRejection({ |
| 139 | +cfg: params.cfgWithAgentDefaults, |
| 140 | + modelOverride, |
| 141 | +error: resolvedOverride.error, |
| 142 | +}), |
126 | 143 | }; |
127 | 144 | } |
128 | 145 | provider = resolvedOverride.ref.provider; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -222,6 +222,7 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
|
222 | 222 | agents: { |
223 | 223 | defaults: { |
224 | 224 | model: { primary: "openai-codex/gpt-5.4", fallbacks: defaultFallbacks }, |
| 225 | +models: { "openai-codex/gpt-5.4": {} }, |
225 | 226 | }, |
226 | 227 | }, |
227 | 228 | }, |
@@ -237,7 +238,7 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
|
237 | 238 | |
238 | 239 | expect(result.status).toBe("error"); |
239 | 240 | expect(result.error).toBe( |
240 | | -"cron payload.model 'anthropic/claude-sonnet-4-6' rejected by agents.defaults.models allowlist: anthropic/claude-sonnet-4-6", |
| 241 | +"cron payload.model 'anthropic/claude-sonnet-4-6' rejected by agents.defaults.models allowlist: anthropic/claude-sonnet-4-6 is not in [openai-codex/gpt-5.4]", |
241 | 242 | ); |
242 | 243 | expect(logWarnMock).not.toHaveBeenCalled(); |
243 | 244 | expect(runWithModelFallbackMock).not.toHaveBeenCalled(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。