Repository navigation
exec-server: simplify pending environment readiness - #32205
Closed
pakrym-oai wants to merge 2 commits into
Closed
pakrym-oai wants to merge 2 commits into
pakrym-oai wants to merge 2 commits into
Conversation
pakrym-oai
marked this pull request as ready for review
July 10, 2026 16:16
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
Environment providers need to register an environment before its stable exec-server URL is available. Completing that registration through a later manager lookup by environment ID couples provisioning to mutable registry state: a stale completion can target a replacement that reused the same ID.
This change gives each pending registration its own one-shot completion capability. The connection path only consumes the terminal result associated with its captured environment, which keeps replacement semantics isolated and makes the readiness flow linear.
What changed
register_pending_environmentreturn aPendingEnvironmentRegistrationthat is consumed bycompletewith either the stable URL or a terminal error.Environment::exec_server_url()getter. There are no in-tree production callers; test infrastructure now retains its own configured URL.This is an alternative implementation of #31988.
Testing
just test -p codex-exec-server --test pending_environmentjust test -p codex-exec-server --lib(181 passed)just test -p codex-core --test all deferred_executor_updates_context_and_tools_after_startupjust test -p codex-core --test all deferred_executor_wait_reports_startup_failure