GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Huge input lag/performance problems when searching model list in TUI · Issue #66326 · anomalyco/opencode

Huge input lag/performance problems when searching model list in TUI #66326

New issue
Copy link
New issue
Copy link
Done
#66370
#66346
Done
Huge input lag/performance problems when searching model list in TUI#66326
#66370
#66346
Copy link
Labels
area/tuiTerminal interfaceplatform/linuxLinuxstatus/repro-simulatedReproduced with a simulated model or mocktype/bugSomething is brokenversion/v2OpenCode 2.x

Description

@paperbenni
paperbenni
opened on Nov 25, 2026
Issue body actions

Description

I have OpenRouter and Kilo authorized, both of which have huge model lists. This leads to second-long input latency, as something in the TUI is seemingly O(something^modelcount)

Plugins

none

OpenCode version

2.4.1

Steps to reproduce

  1. Authorize OpenRouter, Kilo code, likely anything with lots of models
  2. Open the TUI model picker
  3. Search for any model
  4. Horrible performance

Screenshot

opencode_perf.webm

Operating System

Ubuntu 24.02

Terminal

Ghostty

Activity

  1. opencodejr
    added
    area/tuiTerminal interface
    platform/linuxLinux
    type/bugSomething is broken
    version/v2OpenCode 2.x
    on Nov 25, 2026
  2. opencodejr commented on Nov 25, 2026

    @opencodejr
    opencodejrBot
    on Nov 25, 2026
    Contributor
    More actions

    Seen with a simulated model or a mock server, not a real provider; a maintainer should confirm.

    Thanks for the report. I could reproduce the lag on 2.4.1, using generated models in place of real OpenRouter and Kilo catalogs, and it still happens on the latest dev (b5dba31).

    I set up two custom OpenAI-compatible providers in the config with many fake models each, opened /models and typed gatewaya model 512 one key at a time, timing how long each key took to show up in the search box:

    Models Picker open Per keystroke Whole query (18 keys)
    2,000 (2.4.1) ~2.8 s 350–850 ms ~11 s
    2,000 (latest dev) ~2.9 s up to ~950 ms ~13 s
    6,000 (2.4.1) ~7.2 s up to ~6.1 s ~95 s

    Tripling the model count made the slowest keystroke about 7× slower and the whole query about 8× slower. The cost grows faster than the number of models, which matches what you describe. I did not get a comparison run with a small catalog, and I did not check whether older releases were faster.

    The recording and screenshots below show the picker and the search, and the script below reproduces it.

    Related issues:

    • Desktop regression: model list takes 8+ seconds to load and update, freezing the UI #65179: the same kind of slowdown in the Desktop/web model picker, fixed by fix(app): keep the model picker responsive with large catalogs #65189. That fix is in the web/desktop code, not the TUI.
    • Performance issues in the model settings when signed in with OpenRouter #62583: your earlier report about the Web UI model settings.

    https://anoma.ly/team/github-bot/media/0942bf5ce0ee9db913c7a37d5398803f02cc8034ae58339d4b453d502f41d4e5.mp4

    Screenshot

    Screenshot

    Reproduction script (drive.ts)
    // Repro for #66326: TUI model picker search lag with large model catalogs.
    // Two custom OpenAI-compatible providers stand in for OpenRouter and Kilo (N models each).
    import { Effect } from "effect"
    import { OpenCodeDriver } from "opencode-drive"
    
    const N = Number(process.env.MODELS ?? 1000)
    const prov = (name: string) => ({
      name,
      env: ["ACME_API_KEY"],
      package: "@opencode/ai/providers/openai-compatible",
      settings: { baseURL: "http://127.0.0.1:9/v1" },
      models: Object.fromEntries(
        Array.from({ length: N }, (_, i) => [`vendor${i % 20}/model-${i}`, { name: `${name} Model ${i}` }]),
      ),
    })
    
    export default OpenCodeDriver.use(
      {
        opencode: { ...(process.env.OC_DEV ? { dev: process.env.OC_DEV } : {}), env: { ACME_API_KEY: "x" } },
        config: { providers: { gatewaya: prov("GatewayA"), gatewayb: prov("GatewayB") } } as any,
        tui: { recording: true, keypressOverlay: true },
      },
      ({ ui }) =>
        Effect.gen(function* () {
          yield* ui.waitFor("Ask anything", { timeout: 60000 } as any).pipe(Effect.ignore)
          yield* ui.screenshot("home")
          yield* ui.type("/models")
          yield* Effect.sleep(500)
          const t0 = Date.now()
          yield* ui.enter()
          yield* Effect.sleep(2000)
          yield* ui.waitFor("GatewayB Model", { timeout: 120000 } as any)
          console.log(`picker open: ${Date.now() - t0} ms`)
          yield* ui.screenshot("picker-open")
          // Type a query one key at a time; for each key, time until the search box shows it.
          const query = "gatewaya model 512"
          const searchRow = (f: any) =>
            f.lines.map((l: any) => l.spans.map((x: any) => x.text).join("")).find((t: string) => t.includes("esc")) ?? ""
          const times: number[] = []
          for (let i = 0; i < query.length; i++) {
            const prefix = query.slice(0, i + 1)
            const s = Date.now()
            yield* ui.type(query[i])
            while (true) {
              const f = yield* ui.capture()
              if (searchRow(f).includes(prefix.trimEnd()) ) break
              if (Date.now() - s > 120000) break
              yield* Effect.sleep(20)
            }
            times.push(Date.now() - s)
            console.log(`keystroke ${i + 1} ${JSON.stringify(query[i])} echoed after ${Date.now() - s} ms`)
          }
          yield* ui.waitFor("GatewayA Model 512", { timeout: 120000 } as any)
          console.log(`models=${2 * N} total typing ${times.reduce((a, b) => a + b, 0)} ms for ${query.length} keys, max ${Math.max(...times)} ms`)
          yield* ui.screenshot("picker-search")
          yield* Effect.sleep(1000)
        }),
    )

    Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.

  3. opencodejr
    added
    status/repro-simulatedReproduced with a simulated model or mock
    on Nov 25, 2026
  4. neriousy
    closed this as completedin #66370on Nov 25, 2026
  5. neriousy commented on Nov 25, 2026

    @neriousy
    neriousy
    on Nov 25, 2026
    Member
    More actions

    will be fixed in newest release, some data before & after the fix

    models open first key whole query (18 keys)
    2,000 before 300ms 405ms 5.7s
    2,000 after 121ms 94ms 0.21s
    6,000 before 2.6s 3.5s 53.7s
    6,000 after 278ms 271ms 0.8s
    6,000 after, new designs 349ms 185ms 0.73s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/tuiTerminal interfaceplatform/linuxLinuxstatus/repro-simulatedReproduced with a simulated model or mocktype/bugSomething is brokenversion/v2OpenCode 2.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.