OpenCode Reasoning selector: Unknown default on every model + fabricated low/medium/high/xhigh options for zero-variant models
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 64/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Find openCodeCapabilitiesForModel and inferDefaultVariant in the OpenCode driver, then read how the model capability builder handles input.model.variants. Reproduce with OpenCode 2.0.32 using a model with array-shaped variants and one with no variants. Done when array variants yield their IDs and default reasoning is inferred correctly, while models with no variants have no reasoning selector.
Written by the indexing model from the issue text.
Description
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).
- Dominant language
- TypeScript
- Stars
- 24.8k
- Forks
- 6.4k
- Avg merge
- 1h 22m
- Merged PRs (30d)
- 18
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pingdotgg/t3code
-
MCP endpoint matches the Authorization scheme case-sensitively and logs the same reason for "absent" and "wrong scheme" (ChatGPT connector gets missing_bearer_token)Possibly taken A pull request linked to this issue is open or already merged. Openbug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
pingdotgg/t3code#23175 · 2 comments ·
Maintainers usually reply within 1 day
All issues in pingdotgg/t3code
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 76/100
logto-io/logto#9837 · 1 comment ·
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
lingdojo/kana-dojo#32964 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Documentation status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mastra-ai/mastra#28194 · 1 comment ·
Maintainers usually reply within 1 day
-
priority-low refactor-3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 3 days