Skip to content

Commit 8524666

Browse files
authored
fix: gracefully downgrade xhigh thinking level in cron isolated agent (openclaw#9363)
When thinkingDefault is set to "xhigh" but the configured model does not support it (e.g. Claude), the cron isolated-agent path throws a hard error causing the job to fail. The interactive chat path already handles this by silently downgrading to "high". Apply the same graceful downgrade in the cron path: log a warning and fall back to "high" instead of crashing. Co-authored-by: hyf0-agent <hyf0-agent@users.noreply.github.com>
1 parent 54ddbc4 commit 8524666

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cron/isolated-agent/run.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,10 @@ export async function runCronIsolatedAgentTurn(params: {
232232
});
233233
}
234234
if (thinkLevel === "xhigh" && !supportsXHighThinking(provider, model)) {
235-
throw new Error(`Thinking level "xhigh" is only supported for ${formatXHighModelHint()}.`);
235+
logWarn(
236+
`[cron:${params.job.id}] Thinking level "xhigh" is not supported for ${provider}/${model}; downgrading to "high".`,
237+
);
238+
thinkLevel = "high";
236239
}
237240

238241
const timeoutMs = resolveAgentTimeoutMs({

0 commit comments

Comments
 (0)