You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
desktop: hidden models still appear in the model picker's Recent section #60911
Hiding a model in Settings → Models removes it from its provider group, but the model stays visible in the model picker if it is in the "Recent" (or "Favorites") block. A hidden model should not appear anywhere in the picker.
Environment
opencode version: 2.2.5
OS: Windows 10 Pro 19045 (win32 x64)
Terminal: desktop app
Shell: powershell
Install/channel: release (desktop app)
Active plugins: none
Reproduction
Select a model, e.g. opencode/glm-5.3-flash-free, in a session so it is added to Recent.
Open Settings → Models and turn that model off ("Choose which models appear in model picker").
Open /models in a session.
Expected Behavior
The hidden model is not listed anywhere, including the Recent and Favorites sections.
Actual Behavior
The model disappears from its provider group but is still listed under "Recent" (the exact order matches the stored recent array). Selecting any model again keeps writing the old recent list back. Favorites behave the same way.
Additional Context
The picker builds its groups from models filtered by visible(), but recent()/favorites() are merged without that filter, so hidden entries leak through. Because the recent list is stored per client, the same model is correctly absent on other machines/clients that never selected it. On desktop the store is drafts.sqlite (state, name opencode.global.dat, key model).
Workaround: selecting two other models pushes the hidden one out of the 5-entry recent list.
Thanks for the clear report. I could reproduce this.
The desktop app isn't available here, so I used the same app UI served as the web app by opencode serve, with a test provider that has three models (Alpha, Beta, Gamma):
In a session, selected Alpha in the model picker so it was added to Recent.
Turned Alpha off in Settings → Models.
Opened the model picker in a new session.
Alpha was gone from its provider group but still listed under Recent. It happens on 2.2.5 and still on the latest dev (bf544cd). The recording and screenshots below show it, and the script below reproduces it. I only checked Recent, not Favorites.
The code looks like what you describe: the provider groups are filtered by visibility, but the Recent and Favorites lists are not. Related: #60267 (a provider's group disappears once all its models are in Recent). It involves the same picker code but is a different problem.
recording.mp4
Reproduction script (repro.mjs)
// Reproduces anomalyco/opencode#60911 in the OpenCode web app (same UI as the desktop app).// Setup: project with opencode.json declaring provider "mock" (openai-compatible, apiKey "x",// models alpha/beta/gamma named Alpha/Beta/Gamma), then `OPENCODE_PASSWORD=pw opencode serve --port 4097`.// Needs: bun add playwright-core; npx playwright install chromium// Run: CHROME=<chromium path> PASS=pw URL=http://127.0.0.1:4097 bun repro.mjs// (for a source checkout: serve on :4096 with --cors http://127.0.0.1:5173, run vite in packages/app, APP=http://127.0.0.1:5173)import{chromium}from"playwright-core"asyncfunctionopen(url,pass,video,server=url){constb=awaitchromium.launch({executablePath: process.env.CHROME})constctx=awaitb.newContext({viewport: {width: 1400,height: 900}, ...(video ? {recordVideo: {dir: video,size: {width: 1400,height: 900}}} : {})})constp=awaitctx.newPage()awaitp.goto(url);awaitp.waitForTimeout(3000)awaitp.getByText("Use password").click()awaitp.fill("#server-connect-url",server)awaitp.fill("#server-connect-password",pass)awaitp.getByRole("button",{name: "Connect"}).click()awaitp.waitForTimeout(4000)return{ b, ctx, p }}consturl=process.env.URL??"http://127.0.0.1:4097"const{ b, ctx, p }=awaitopen(process.env.APP??url,process.env.PASS,process.env.VIDEO,url)constout=process.env.OUT??"/workspace/repro"awaitp.getByRole("button",{name: "New session"}).first().click();awaitp.waitForTimeout(3000)// 1. Select Alpha in the picker so it is added to Recentawaitp.getByRole("button",{name: "Choose model variant"}).locator("xpath=preceding::button[1]").click();awaitp.waitForTimeout(1500)awaitp.getByRole("dialog").getByText("Alpha",{exact: true}).click();awaitp.waitForTimeout(1500)// 2. Hide Alpha in Settings -> Modelsawaitp.getByRole("button",{name: "Home"}).first().click();awaitp.waitForTimeout(1500)awaitp.getByRole("button",{name: "Settings"}).first().click();awaitp.waitForTimeout(1500)awaitp.getByText("Models",{exact: true}).first().click();awaitp.waitForTimeout(1500)awaitp.getByRole("switch",{name: "Alpha"}).click({force: true});awaitp.waitForTimeout(1000)console.log("Alpha switch checked:",awaitp.getByRole("switch",{name: "Alpha"}).getAttribute("aria-checked"))awaitp.screenshot({path: `${out}/1-alpha-hidden.png`})// 3. Back to the app, new session, open the pickerawaitp.getByRole("button",{name: "Back to app"}).click();awaitp.waitForTimeout(1500)awaitp.getByRole("button",{name: "New session"}).first().click();awaitp.waitForTimeout(3000)awaitp.getByRole("button",{name: "Choose model variant"}).locator("xpath=preceding::button[1]").click();awaitp.waitForTimeout(1500)consttext=awaitp.getByRole("dialog").innerText()console.log("--- picker ---\n"+text)awaitp.screenshot({path: `${out}/2-picker-shows-hidden-alpha.png`})console.log("Alpha listed in picker after hiding:",/\bAlpha\b/.test(text))awaitp.waitForTimeout(1000)awaitctx.close();awaitb.close()
I'll take a look at this. My plan: trace how the model picker builds its groups vs. recent()/favorites(), apply the same visible() filter to Recent and Favorites, add a regression test for a hidden model in Recent/Favorites, and run the affected package's tests and typecheck before opening a PR.
Activity
opencodejr commentedon Oct 31, 2026
Thanks for the clear report. I could reproduce this.
The desktop app isn't available here, so I used the same app UI served as the web app by
opencode serve, with a test provider that has three models (Alpha, Beta, Gamma):Alpha was gone from its provider group but still listed under Recent. It happens on 2.2.5 and still on the latest
dev(bf544cd). The recording and screenshots below show it, and the script below reproduces it. I only checked Recent, not Favorites.The code looks like what you describe: the provider groups are filtered by visibility, but the Recent and Favorites lists are not. Related: #60267 (a provider's group disappears once all its models are in Recent). It involves the same picker code but is a different problem.
recording.mp4
Reproduction script (repro.mjs)
Run it:
bun repro.mjsjimmyallinai commentedon Oct 31, 2026
I'll take a look at this. My plan: trace how the model picker builds its groups vs. recent()/favorites(), apply the same visible() filter to Recent and Favorites, add a regression test for a hidden model in Recent/Favorites, and run the affected package's tests and typecheck before opening a PR.