refactor: reuse shared model prefix helper in thinking

This commit is contained in:
Peter Steinberger 2026-03-27 23:59:44 +00:00
parent 7da92cc618
commit 13316a9118
1 changed files with 2 additions and 4 deletions

View File

@ -1,3 +1,5 @@
import { matchesExactOrPrefix } from "../plugins/provider-model-helpers.js";
export type ThinkLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "adaptive";
export type VerboseLevel = "off" | "on" | "full";
export type NoticeLevel = "off" | "on" | "full";
@ -29,10 +31,6 @@ const OPENAI_CODEX_XHIGH_MODEL_IDS = [
] as const;
const GITHUB_COPILOT_XHIGH_MODEL_IDS = ["gpt-5.2", "gpt-5.2-codex"] as const;
function matchesExactOrPrefix(modelId: string, ids: readonly string[]): boolean {
return ids.some((candidate) => modelId === candidate || modelId.startsWith(`${candidate}-`));
}
export function normalizeProviderId(provider?: string | null): string {
if (!provider) {
return "";