Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Closed Beginner friendly
#22,054 3 comments 0 reactions 0 assignees View on GitHub

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

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).

Dominant language
TypeScript
Stars
24.8k
Forks
6.4k
Avg merge
1h 22m
Merged PRs (30d)
18

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pingdotgg/t3code

All issues in pingdotgg/t3code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.