fix(tui): show providers in Mini model search (#38321)

This commit is contained in:
Simon Klee 2026-07-22 16:02:17 +02:00 committed by GitHub
commit 4204b9d087
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 2 deletions

View file

@ -1069,7 +1069,11 @@ export function RunModelSelectBody(props: {
>
<RunFooterMenu
theme={props.theme}
items={controller.items}
items={() =>
controller.query().trim()
? controller.items().map((item) => ({ ...item, footer: item.providerName }))
: controller.items()
}
selected={controller.menu.selected}
offset={controller.menu.offset}
rows={() => PANEL_LIST_ROWS}

View file

@ -1498,7 +1498,10 @@ test("direct permission rejection submits through keymap return binding", async
})
test("direct model panel renders current model selector", async () => {
const [providers] = createSignal<RunProvider[] | undefined>([provider()])
const [providers] = createSignal<RunProvider[] | undefined>([
provider(),
{ id: "openai", name: "OpenAI", models: { "gpt-5": model({ id: "gpt-5", name: "GPT-5" }) } },
])
const [current] = createSignal<RunInput["model"]>({ providerID: "opencode", modelID: "gpt-5" })
const app = await testRender(
@ -1535,6 +1538,14 @@ test("direct model panel renders current model selector", async () => {
expect(frame).not.toContain("┃")
expect(frame).not.toContain("Old Model")
expectPaletteList(list, 2)
"gpt-5".split("").forEach((key) => app.mockInput.pressKey(key))
await app.renderOnce()
const search = app.captureCharFrame()
expect(search.match(/GPT-5/g)).toHaveLength(2)
expect(search).toContain("opencode")
expect(search).toContain("OpenAI")
} finally {
app.renderer.destroy()
}