Defer fresh TUI startup hydration#21857
Draft
starr-openai wants to merge 2 commits intomainfrom
Draft
Conversation
Render the fresh-start TUI before model/catalog and thread startup hydration complete. Queue early Codex ops until the primary thread is attached, then drain them after the background bootstrap finishes. Add startup timing spans around model catalog loading, thread startup, Codex spawn, and session initialization so startup measurements can separate first-frame latency from background hydration work. This is intentionally opened as a draft prototype. Known follow-ups include restoring startup model migration prompts and startup tooltip prefetch behavior on the deferred path, and tightening any dead-code warnings introduced by the split. Co-authored-by: Codex <noreply@openai.com>
Keep real bootstrap and model migration synchronous, then defer only interactive fresh thread startup. Attach the background thread with the existing primary-thread routing path instead of carrying provisional bootstrap state through the TUI. Remove the broad startup op queue and duplicated background bootstrap helper; ChatWidget already queues user text until session configuration is ready. Co-authored-by: Codex <noreply@openai.com>
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.
Summary
thread/startMeasurement
Warm cached runs against the opt Bazel binary:
472msfirst_frame_readymedian:778msthread/startcompletion median:1499ms~723msmedianThe remaining cold-start cost is still bootstrap/model-list/account work; this version deliberately preserves that synchronous path for correctness and reviewability.
Validation
just fmt/Users/starr/code/openai/project/dotslash-gen/bin/bazel build -c opt --bes_backend= --bes_results_url= //codex-rs/cli:codex./bazel-bin/codex-rs/cli/codex --versionthread/startsuccessfully and was terminated intentionallyDraft Notes