fix(ai): filter deprecated OpenCode models from generation (#970)

Add status === 'deprecated' check for OpenCode Zen models, matching
the existing pattern used for GitHub Copilot models. This removes
deprecated models like glm-4.7-free and minimax-m2.1-free from the
generated model catalog.
This commit is contained in:
Daniel Tatarkin 2026-01-26 17:56:13 -05:00 committed by GitHub
parent a5f603d704
commit 9f3eef65f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 54 deletions

View file

@ -482,8 +482,9 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
// - null/undefined/@ai-sdk/openai-compatible → openai-completions
if (data.opencode?.models) {
for (const [modelId, model] of Object.entries(data.opencode.models)) {
const m = model as ModelsDevModel;
const m = model as ModelsDevModel & { status?: string };
if (m.tool_call !== true) continue;
if (m.status === "deprecated") continue;
const npm = m.provider?.npm;
let api: Api;