Avoid blocking TUI on agent metadata hydration#21870
Open
etraut-openai wants to merge 1 commit intomainfrom
Open
Avoid blocking TUI on agent metadata hydration#21870etraut-openai wants to merge 1 commit intomainfrom
etraut-openai wants to merge 1 commit intomainfrom
Conversation
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.
Why
Fixes #16688.
The TUI currently hydrates collab receiver metadata by awaiting
thread/readbefore each active-thread notification is rendered. During large subagent fan-outs, the embedded app-server can be busy starting agents and processing spawn work, so those synchronous metadata reads queue behind the fan-out and block the TUI event loop. That makes the UI appear frozen even though the underlying agent work can continue.What Changed
thread/readmetadata hydration on the active notification path with local receiver-thread caching.ThreadStartedand picker refreshes as the places that fill in agent nickname/role metadata when it is available.NotFound, avoiding live-looking ghost entries for failed stale-agent calls.NotFoundsuppression.Verification
cargo test -p codex-tui collab_receiver_notificationjust fix -p codex-tuiI also ran the full
cargo test -p codex-tui; the new test passed, but the full process later aborted with an unrelated stack overflow intests::fork_last_filters_latest_session_by_cwd_unless_show_all.