mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:20:43 +00:00
Summary: - The PR removes `max` from OpenRouter DeepSeek V4 thinking profiles, maps stale OpenRouter `max` overrides to `xhigh`, preserves direct DeepSeek behavior, and updates docs, tests, and changelog. - Reproducibility: yes. Source inspection on current main shows OpenRouter DeepSeek V4 advertises `max` and se ... ffort: "max"`, matching the linked 400 logs; I did not need a live OpenRouter request for this assist pass. Automerge notes: - Ran the ClawSweeper repair loop before final review. - Addressed earlier ClawSweeper review findings before merge. - Included post-review commit in the final squash: docs(changelog): credit OpenRouter duplicate fix - Included post-review commit in the final squash: fix(openrouter): keep DeepSeek V4 reasoning effort valid Validation: - ClawSweeper review passed for headbecdea4223. - Required merge gates passed before the squash merge. Prepared head SHA:becdea4223Review: https://github.com/openclaw/openclaw/pull/77423#issuecomment-4372880583 Co-authored-by: sallyom <somalley@redhat.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
35 lines
971 B
TypeScript
35 lines
971 B
TypeScript
import type { ProviderThinkingProfile } from "openclaw/plugin-sdk/plugin-entry";
|
|
import { isOpenRouterDeepSeekV4ModelId } from "./models.js";
|
|
|
|
const OPENROUTER_DEEPSEEK_V4_THINKING_LEVEL_IDS = [
|
|
"off",
|
|
"minimal",
|
|
"low",
|
|
"medium",
|
|
"high",
|
|
"xhigh",
|
|
] as const;
|
|
|
|
function buildOpenRouterDeepSeekV4ThinkingLevel(
|
|
id: (typeof OPENROUTER_DEEPSEEK_V4_THINKING_LEVEL_IDS)[number],
|
|
) {
|
|
return { id };
|
|
}
|
|
|
|
const OPENROUTER_DEEPSEEK_V4_THINKING_PROFILE = {
|
|
levels: OPENROUTER_DEEPSEEK_V4_THINKING_LEVEL_IDS.map(buildOpenRouterDeepSeekV4ThinkingLevel),
|
|
defaultLevel: "high",
|
|
} satisfies ProviderThinkingProfile;
|
|
|
|
export function supportsOpenRouterXHighThinking(modelId: string): boolean {
|
|
return isOpenRouterDeepSeekV4ModelId(modelId);
|
|
}
|
|
|
|
export function resolveOpenRouterThinkingProfile(
|
|
modelId: string,
|
|
): ProviderThinkingProfile | undefined {
|
|
return isOpenRouterDeepSeekV4ModelId(modelId)
|
|
? OPENROUTER_DEEPSEEK_V4_THINKING_PROFILE
|
|
: undefined;
|
|
}
|