Skip to content

fix(tui): cycle model variants from default#36096

Closed
tobwen wants to merge 1 commit into
anomalyco:devfrom
tobwen:variant-cycle
Closed

fix(tui): cycle model variants from default#36096
tobwen wants to merge 1 commit into
anomalyco:devfrom
tobwen:variant-cycle

Conversation

@tobwen

@tobwen tobwen commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #36095

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR fixes TUI variant cycling when a model defines a real variant named default. The cycle logic now uses a non-default cycle order internally, so ctrl+t moves through configured variants such as high, max, and none before returning to the default state.

The previous logic used the full variant list. Because set(undefined) stores default, a list like high, max, default, and none made the cycle jump from default to none, then back to default. The visible variant list and dialog behavior are unchanged.

How did you verify your code works?

  • Added regression coverage for nextVariantInCycle with high, max, default, and none.
  • Verified the regression test fails with the old cycle behavior: default returned none instead of high.
  • Ran bun test test/context/local.test.ts from packages/tui.
  • Ran bun typecheck from packages/tui.
  • Built the single Linux binary with bun run build -- --single from packages/opencode and confirmed the build smoke test passed.
  • Manually verified that ctrl+t cycles through default, high, max, and none for the affected model.

Screenshots / recordings

Not included. The change affects keyboard cycling behavior in the TUI.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI variant cycling skips variants

1 participant