Skip to content

TUI blocks its first render on the full 6.6 MB provider catalog #53679

Closed as duplicate

Description

@Nowaker

Description

The TUI cannot show its prompt until GET /provider has returned, and that response is the whole models.dev catalog: on an install with one provider connected it is 6.6 MB (226 providers, 8,405 models). The server worker has to build and JSON-encode all of it at startup, and the TUI has to parse it, before the first render.

The data goes into provider_next, which only the provider connect dialog reads.

Measured with a compiled 1.18.34 on macOS (M2 Pro), the call takes 1.2 s warm and 4.1 s on first call on a loaded Linux host. Moving it out of the blocking bootstrap cuts launch-to-typable-prompt by about 250 ms (12%) on an idle machine, more on a busy one.

Plugins

none (--pure)

OpenCode version

1.18.34, current dev (ecc4916)

Steps to reproduce

  1. opencode serve --pure, then curl -o /dev/null -w '%{size_download} %{time_total}\n' localhost:<port>/provider
  2. Compare with /config/providers (9 KB, 10 ms), which the TUI also loads at startup and which is what it actually renders from.

Operating System

macOS 15 (M2 Pro), Arch Linux x64

Terminal

tmux

Activity

  1. opencode-agent commented on Oct 7, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed measurements! This looks like the same problem as #41078: the TUI waits for the full /provider catalog before its first render, when only the connect dialog needs it. Your numbers are a useful addition there. Open PR #53593 also stops the TUI loading /provider at startup and loads it only when a connect dialog opens.

    Also note that 1.18.34 is OpenCode v1, which now only gets critical fixes. v2 (@opencode/cli, the opencode2 command) is where active work happens.

    The bot will close this issue as a duplicate of #41078 in 1 day, unless you reply explaining how your problem is different.

  2. github-actions commented on Oct 7, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • #53590: Reports the same TUI bootstrap fetching and parsing the full provider catalog before it is needed.
    • #47677: Reports the full /provider catalog being fetched during app bootstraps even though startup only needs connected providers.
    • #41078: Reports the TUI first content being blocked by a large /provider payload and proposes loading asynchronously.
    • #52821: Reports the provider catalog adding startup delay and asks to defer loading it.
  3. opencode-agent commented on Oct 8, 2026

    @opencode-agent
    Contributor

    Closing this as a duplicate of #41078, since there was no reply about how this differs. That issue covers the same problem: the TUI waits for the full /provider catalog before its first render, when only the connect dialog needs it. Please follow it there, and feel free to add your measurements. Open PR #53593 also stops the TUI loading /provider at startup.

    Correction to my earlier comment: v2 is the @opencode/cli package, and its command is opencode, not opencode2.

    If you see something different from #41078, especially on v2, please open a new issue with the details. Thanks!

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions