Files
42e6972d35 fix(opencode): Zen GPT-5.6 models are missing from discovery (#110405)
* fix(opencode): add Zen GPT-5.6 models

* test(opencode): narrow GPT-5.6 policy fixture

* fix(opencode): align GPT-5.6 thinking levels

Co-authored-by: 杨浩宇0668001029 <yang.haoyu@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-18 11:14:05 +01:00

30 lines
858 B
TypeScript

// Opencode API module exposes the plugin public contract.
import type {
ProviderDefaultThinkingPolicyContext,
ProviderThinkingProfile,
} from "openclaw/plugin-sdk/plugin-entry";
import { resolveClaudeThinkingProfile } from "openclaw/plugin-sdk/provider-model-shared";
const GPT_56_THINKING_PROFILE = {
levels: [
{ id: "off" },
{ id: "low" },
{ id: "medium" },
{ id: "high" },
{ id: "xhigh" },
{ id: "max" },
],
defaultLevel: "medium",
} as const satisfies ProviderThinkingProfile;
function isGpt56Model(modelId: string): boolean {
return /^gpt-5\.6(?:-|$)/u.test(modelId.trim().toLowerCase());
}
export function resolveThinkingProfile(params: ProviderDefaultThinkingPolicyContext) {
if (isGpt56Model(params.modelId)) {
return GPT_56_THINKING_PROFILE;
}
return resolveClaudeThinkingProfile(params.modelId);
}