Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

OpenCode Reasoning selector: Unknown default on every model + fabricated low/medium/high/xhigh options for zero-variant models

Chiusa Adatta ai principianti
#22,054 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
64/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Trova openCodeCapabilitiesForModel e inferDefaultVariant nel driver OpenCode, poi leggi come il builder delle funzionalità del modello gestisce input.model.variants. Riproduci il problema con OpenCode 2.0.32 usando un modello con varianti sotto forma di array e uno senza varianti. Il lavoro è completato quando le varianti sotto forma di array restituiscono i relativi ID e il ragionamento predefinito viene dedotto correttamente, mentre i modelli senza varianti non hanno un selettore del ragionamento.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

needs more info via-triage

Two related bugs in the OpenCode driver's model-capability builder (openCodeCapabilitiesForModel, confirmed in the 0.1.1-nightly.20261019.3373 binary):

1. Reasoning always defaults to "Unknown", even for openai native models

The builder reads variant values with:

const rawVariantValues = Object.keys(input.model.variants ?? {});

but opencode 2.0.32's GET /api/model returns variants as an array of {id, settings} objects, so Object.keys() yields ["0", "1", "2", ...] (indices). inferDefaultVariant then can never match:

if (providerID === "openai" || providerID === "opencode")
  return variants.includes("medium") ? "medium" : variants.includes("high") ? "high" : void 0;

because the values are numeric strings, so every model — including openai/gpt-6-luna with 6 real variants (none/low/medium/high/xhigh/max) — shows Reasoning: Unknown until manually picked. Options rendered from the indices are also wrong (labels like "0", "1", "2").

2. Zero-variant models get a fabricated selector

const variantValues = rawVariantValues.length > 0 ? rawVariantValues : ["low", "medium", "high", "xhigh"];

Models that legitimately have no variants (e.g. opencode-go mimo-v2.6-pro / mimo-v2.6-flash — opencode's built-in provider defines no variants for them, and config-side "variants": {} correctly yields [] in /api/model) still get a Reasoning select with the hardcoded low/medium/high/xhigh options. Picking one is harmless server-side (opencode ignores the unknown variant; turns complete), but the UI advertises reasoning levels the model does not have.

Suggested fix

Normalize first (accept both array-of-{id} and record shapes, use variant.id), and skip the variant option descriptor entirely when the resolved variant list is empty instead of falling back to a hardcoded set.

Seen on opencode 2.0.32 + t3 0.1.1-nightly.20261019.3373 (also repros on 20261017.3272).

Lingua principale
TypeScript
Stelle
24.8k
Fork
6.4k
Merge medio
3h 39m
PR unite (30g)
301

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pingdotgg/t3code

Tutte le issue di pingdotgg/t3code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.