Skip to content

fix(tui): keep Kilo Gateway models visible in the model picker - #13170

Merged
johnnyeric merged 3 commits into
mainfrom
johnnyeric/tui-gateway-model-picker
Aug 18, 2026
Merged

fix(tui): keep Kilo Gateway models visible in the model picker#13170
johnnyeric merged 3 commits into
mainfrom
johnnyeric/tui-gateway-model-picker

Conversation

@johnnyeric

@johnnyeric johnnyeric commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Issue

No public issue. Internal report: after using Bedrock in the TUI, Kilo Gateway sonnets disappeared from the Kilo Gateway section and from a kilo filter.

Context

The TUI picker moved recommended Kilo models into a Recommended section and then stripped recents out of their provider group. Search only matched title + section header, so typing kilo missed those rows.

Implementation

Extracted the option builder into a kilo-owned module. Recents stay in their provider / Recommended section. Search also matches provider name and ids.

Favorites are still deduped out of the provider section (they already have their own). Recently used models now appear twice (Recent + provider).

dialog-select.tsx now matches the selected row by object reference, not value. Once recents can also sit in their provider section, value equality highlighted both copies and hover jumped to Recent.

Screenshots / Video

Before (recents strip)

Screenshot 2026-08-18 at 12 16 06 Screenshot 2026-08-18 at 12 15 55 Screenshot 2026-08-18 at 12 38 12 Screenshot 2026-08-18 at 12 54 58

After (recents stay in their section)

Screenshot 2026-08-18 at 12 17 22 Screenshot 2026-08-18 at 12 17 39 Screenshot 2026-08-18 at 12 36 07 Screenshot 2026-08-18 at 12 56 06

Human A/B on query kilo: on main, Recent and Recommended vanish and only the Kilo Gateway long tail remains (titles have no "kilo", category is Recommended/Recent). On this branch both sections stay filled. Filtered order is fuzzysort, not recommendedIndex.

How to Test

Manual/local verification

  • Agent: bunx tsgo --noEmit in packages/tui — clean
  • Agent: bun test in packages/tui — pass
  • Agent: temporarily reverting the two picker rules fails 3 of the new tests
  • Human: pick GPT-5.6 Sol, reopen /models — Sol is under Recent and OpenAI
  • Human: type kilo — Recent / Recommended Kilo rows still match; Claude Opus 5 can appear twice with only one highlight

Reviewer test steps

  1. cd packages/tui && bun test test/kilocode/model-picker.test.ts
  2. Pick any non-Kilo model (GPT is enough; Bedrock is not required), reopen the picker. That model should still be in its provider section.
  3. Type kilo. Recommended / recent Kilo models should still match.

Blocked checks and substitute verification

  • Agent: no live Kilo Gateway TUI session in the original environment. Human later ran the picker A/B above.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Get in Touch

Selecting a model removed it from its provider section, so a recently
used Kilo sonnet vanished from "Recommended"/"Kilo Gateway" and only
survived under "Recent". Search also keyed off title and section header
only, so filtering by `kilo` never matched titles like "Anthropic Claude
Sonnet 4.5" grouped under "Recommended".

Recents now stay in their provider section (favorites are still deduped
into their own section) and search additionally keys off the provider
name, provider id, and model id, matching the VS Code selector.

Option building moves to kilocode/model-picker.ts so the grouping and
search rules are unit testable.
@johnnyeric
johnnyeric force-pushed the johnnyeric/tui-gateway-model-picker branch from ffaedd9 to 942d9ce Compare August 18, 2026 09:20
Keeping recents in their provider section means a model can legitimately
appear twice in the list (once under "Recent", once under its provider or
"Recommended" section). DialogSelect resolved the selected row by value
equality, so both copies lit up as active whenever either was selected —
visible on every picker open, since the current model is usually a recent
— and hovering the provider-section copy warped selection and scroll to
the "Recent" copy instead.

Match the selected row by object reference instead. Rows are always
distinct objects, so this is a strict refinement for every other dialog;
`current` still uses value equality, which is correct — both rows really
are the current model.
@johnnyeric
johnnyeric marked this pull request as ready for review August 18, 2026 10:19
Comment thread packages/tui/src/kilocode/model-picker.ts
@kilo-code-bot

kilo-code-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/tui/src/kilocode/model-picker.ts 170 Keeping recents in provider sections introduces duplicate rows; dialog-select.tsx's value-based preserveSelection path snaps selection to the first duplicate (Recent/Favorites copy) on list recompute

The extraction into kilocode/model-picker.ts is clean and faithful to the old behavior, the reference-identity fix in dialog-select.tsx is a strict refinement of the previous value-equality matching, tests exercise the real builder without mocks, and the changeset correctly targets @kilocode/cli (which bundles the TUI). No memory leaks, security, or correctness blockers found. The single suggestion is a minor UX edge left over from the duplicate-row change.

Fix these issues in Kilo Cloud

Files Reviewed (5 files)
  • packages/tui/src/component/dialog-model.tsx - 0 issues
  • packages/tui/src/kilocode/model-picker.ts - 1 issue
  • packages/tui/src/ui/dialog-select.tsx - 0 issues
  • packages/tui/test/kilocode/model-picker.test.ts - 0 issues
  • .changeset/tui-gateway-model-picker.md - 0 issues

Reviewed by kimi-k3 · Input: 110.2K · Output: 10.9K · Cached: 477.7K

Review guidance: REVIEW.md from base branch main

@johnnyeric
johnnyeric merged commit 3acb1ec into main Aug 18, 2026
44 of 47 checks passed
@johnnyeric
johnnyeric deleted the johnnyeric/tui-gateway-model-picker branch August 18, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants