mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
* 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>
30 lines
858 B
TypeScript
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);
|
|
}
|