From 0deb67f273d8059a9e83ea63cb026d837ac9b127 Mon Sep 17 00:00:00 2001 From: Albert Date: Sat, 21 Mar 2026 10:18:13 +0800 Subject: [PATCH] fix: preserve provider prefix in cron model suggestions The Control UI cron model field suggestions were built using only the model ID (e.g. "gpt-oss:120b-cloud") without the provider prefix (e.g. "ollama/"). When a user selected such a suggestion, the server would fall back to the session's default provider (typically "anthropic"), producing an error like: Failed to set model: model not allowed: anthropic/gpt-oss:120b-cloud Fix loadCronModelSuggestions to include the provider prefix in each suggestion so the submitted value is fully qualified (e.g. "ollama/gpt-oss:120b-cloud"), matching the same format used by the chat session model picker. Fixes openclaw/openclaw#51306 --- ui/src/ui/controllers/cron.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/src/ui/controllers/cron.ts b/ui/src/ui/controllers/cron.ts index c81d69c57ea..1fd172aa5a9 100644 --- a/ui/src/ui/controllers/cron.ts +++ b/ui/src/ui/controllers/cron.ts @@ -203,8 +203,13 @@ export async function loadCronModelSuggestions(state: CronModelSuggestionsState) if (!entry || typeof entry !== "object") { return ""; } - const id = (entry as { id?: unknown }).id; - return typeof id === "string" ? id.trim() : ""; + const { id, provider } = entry as { id?: unknown; provider?: unknown }; + const modelId = typeof id === "string" ? id.trim() : ""; + if (!modelId) { + return ""; + } + const modelProvider = typeof provider === "string" ? provider.trim() : ""; + return modelProvider ? `${modelProvider}/${modelId}` : modelId; }) .filter(Boolean); state.cronModelSuggestions = Array.from(new Set(ids)).toSorted((a, b) => a.localeCompare(b));