[app-server] Add lossless in-process event delivery#28460
Draft
adamvy-oai wants to merge 3 commits into
Draft
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
This was referenced Jun 16, 2026
a70301e to
5569b5a
Compare
53b0ae8 to
aa5343c
Compare
aa5343c to
16d35f1
Compare
5569b5a to
ec3b1ca
Compare
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.
Overview
This is the second change in a five-PR stack that improves the Rust embedding API for
codex-app-server. It builds on the explicit start options from the first PR by making event-delivery guarantees and shutdown sequencing configurable.What
InProcessEventDelivery::{BestEffort, Lossless}InProcessShutdown,begin_shutdown(), andfinish_shutdown()APIsWhy
Best-effort delivery is appropriate for existing callers that must not block on a slow event consumer. Some embedders instead need every ordered event and are prepared to apply backpressure. Making that choice explicit avoids silently changing current callers.
Lossless delivery also requires a drainable shutdown sequence.
begin_shutdown()closes client-message intake, drains requests that the runtime already accepted, and lets callers drain the event stream until it closes.finish_shutdown()then joins the runtime after delivery is complete.Stack
Each PR is based on the preceding branch:
Validation
Validation for the final stacked commits:
just test -p codex-app-server: 886 passed; one timing retry passed on its second attemptjust test -p codex-core: 2,717 passed; eight timing-sensitive failures passed in focused reruns, while five high-output code-mode failures remainedjust test --test-threads=8: 10,944 of 10,958 passed; the remaining failures were the same five high-output tests, three timing-sensitive tests that pass in focused reruns, and six tests in untouched exec/TUI code affected by this host's managed permission policyupstream/maincommitjust fix -p codex-app-server,just fix -p codex-core, andjust fmt; final worktree clean