Repository navigation
Preserve TUI event ordering during active-thread draining - #39991
Merged
copyberry[bot] merged 1 commit intoAug 21, 2026
Conversation
## Why Draining every queued active-thread event in one foreground pass can overrun the frame budget. Buffered thread events can also race ahead of queued replay and startup app events, causing the TUI to switch views before the corresponding history and operations have been applied. ## What changed - Bound active-thread draining to one target frame interval and leave remaining notifications queued for a later frame. - Prioritize queued app events over active-thread events so replay state is applied before buffered closures or other thread notifications. - Block startup input only for pending requests, rather than ordinary queued notifications whose draining yielded at the frame deadline. - Leave selected side-thread closure handling to the foreground event loop. ## Testing Added tests covering deadline-limited notification draining and foreground handling of a selected side thread closing. GitOrigin-RevId: 41080d3df13ca308eec1ea0fbb0ba067a4640c4c
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/41080d3df13ca308eec1ea0fbb0ba067a4640c4c
branch
from
August 21, 2026 18:44
607d640 to
f6519a3
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/41080d3df13ca308eec1ea0fbb0ba067a4640c4c
branch
August 21, 2026 18:45
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Preserve TUI event ordering during active-thread draining
Why
Draining every queued active-thread event in one foreground pass can overrun the
frame budget. Buffered thread events can also race ahead of queued replay and
startup app events, causing the TUI to switch views before the corresponding
history and operations have been applied.
What changed
notifications queued for a later frame.
applied before buffered closures or other thread notifications.
notifications whose draining yielded at the frame deadline.
Testing
Added tests covering deadline-limited notification draining and foreground
handling of a selected side thread closing.