[PR #9179] Hide variants hint when list empty #13018

Closed
opened 2026-02-16 18:17:54 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9179

State: closed
Merged: Yes


The fix is complete. The change wraps the "variants" hint in a <Show> component that only renders when local.model.variant.list().length > 0. This means:

  1. When the current model has variants defined, the hint will be displayed
  2. When the current model has no variants (empty array), the hint will be hidden

The local.model.variant.list() function at packages/opencode/src/cli/cmd/tui/context/local.tsx:326-333 already handles the logic of returning an empty array when there are no variants:

  • Returns [] if there's no current model
  • Returns [] if the model doesn't have info.variants defined
  • Otherwise returns the variant keys

Closes #9162

New%20session%20-%202026-01-18T02%3A27%3A01.312Z
opencode session  |  github run

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9179 **State:** closed **Merged:** Yes --- The fix is complete. The change wraps the "variants" hint in a `<Show>` component that only renders when `local.model.variant.list().length > 0`. This means: 1. When the current model has variants defined, the hint will be displayed 2. When the current model has no variants (empty array), the hint will be hidden The `local.model.variant.list()` function at `packages/opencode/src/cli/cmd/tui/context/local.tsx:326-333` already handles the logic of returning an empty array when there are no variants: - Returns `[]` if there's no current model - Returns `[]` if the model doesn't have `info.variants` defined - Otherwise returns the variant keys Closes #9162 <a href="https://opencode.ai/s/sAl4g82v"><img width="200" alt="New%20session%20-%202026-01-18T02%3A27%3A01.312Z" src="https://social-cards.sst.dev/opencode-share/TmV3IHNlc3Npb24gLSAyMDI2LTAxLTE4VDAyOjI3OjAxLjMxMlo=.png?model=opencode/claude-opus-4-5&version=1.1.25&id=sAl4g82v" /></a> [opencode session](https://opencode.ai/s/sAl4g82v)&nbsp;&nbsp;|&nbsp;&nbsp;[github run](/anomalyco/opencode/actions/runs/21104575552)
yindo added the pull-request label 2026-02-16 18:17:54 -05:00
yindo closed this issue 2026-02-16 18:17:54 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13018