fix(sdk): gate reasoning effort by runtime allowlist

This commit is contained in:
radioflyer28
2026-05-13 22:27:15 -04:00
parent c20f714d68
commit 810778e137
7 changed files with 80 additions and 6 deletions

View File

@@ -30,8 +30,11 @@ import {
VALID_PROFILES,
getAgentToModelMapForProfile,
resolveRuntimeTierDefault,
runtimesWithReasoningEffort,
} from '../model-catalog.js';
const RUNTIMES_WITH_REASONING_EFFORT = runtimesWithReasoningEffort();
// ─── configGet ──────────────────────────────────────────────────────────────
/**
@@ -151,7 +154,11 @@ function resolveRuntimeTier(config: Record<string, unknown>, tier: string): Runt
const userEntry = normalizeRuntimeTierEntry(runtimeOverrides?.[tier]);
if (!builtin && !userEntry) return null;
return { ...(builtin ?? {}), ...(userEntry ?? {}) };
const merged = { ...(builtin ?? {}), ...(userEntry ?? {}) };
if (!RUNTIMES_WITH_REASONING_EFFORT.has(runtime)) {
delete merged.reasoning_effort;
}
return merged;
}
/**