Repository navigation
Conversation
The blocking bootstrap waited for GET /provider, which returns every models.dev provider and model: 6.6 MB, 226 providers and 8,405 models for an install with one provider connected. Building and encoding it costs the server worker 1.2 s warm (4.1 s on first call) on a loaded host, and the TUI parses all of it before the prompt can appear. Only the connect dialog reads provider_next, and the store already starts with an empty value, so the request moves to the non-blocking group that runs after the prompt is shown. Launch to a typable prompt, compiled binary, macOS M2 Pro, median (min-max) of 10 relaunches in ABBA order: home screen 2235 (2183-2277) ms -> 1976 (1928-2048) ms 3,906-message session 2575 (2523-2625) ms -> 2331 (2295-2421) ms
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Nowaker
force-pushed
the
tui-lazy-provider-list
branch
from
October 7, 2026 11:13
186f5c6 to
3c4a6b3
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #53679
Type of change
What does this PR do?
The TUI's blocking bootstrap waits on
sdk.client.provider.list()(GET /provider) before it shows the prompt. That response is the entire models.dev catalog, 6.6 MB for an install with one connected provider, and the only reader of the resultingprovider_nextstore is the connect dialog.This moves that one request into the existing non-blocking group that runs after the prompt is shown.
provider_nextalready starts with an empty value ({ all: [], default: {}, connected: [] }), so nothing readsundefinedwhile it loads; the connect dialog opened in the first moment would list providers a beat later. Everything the prompt and model picker use comes fromconfig.providers(), which stays blocking.How did you verify your code works?
packages/tuitypecheck, andtest/app-lifecycle.test.tsx,test/runtime.test.tsx,test/context(7 pass).--pure, median (min-max) of 10 relaunches in ABBA order:/connectin a launched binary after startup: the full provider list (302.AI, Abacus, ...) is listed.Screenshots / recordings
n/a, no visual change
Checklist
This PR is AI generated, but under direct supervision and on request of @Nowaker.