Make environment providers own default selection#20665
Draft
starr-openai wants to merge 7 commits intostarr/exec-env-stdio-stack-2-clientfrom
Draft
Make environment providers own default selection#20665starr-openai wants to merge 7 commits intostarr/exec-env-stdio-stack-2-clientfrom
starr-openai wants to merge 7 commits intostarr/exec-env-stdio-stack-2-clientfrom
Conversation
This was referenced May 1, 2026
d2b7397 to
7eff29b
Compare
225bb6b to
ae52105
Compare
773f789 to
387ab7a
Compare
3ae465a to
d7095cf
Compare
387ab7a to
3fe0b35
Compare
d7095cf to
a38f8e5
Compare
f12eaed to
56ada0d
Compare
4e89a77 to
0781da0
Compare
56ada0d to
abde0bf
Compare
0781da0 to
1a11c8b
Compare
abde0bf to
e0ff30e
Compare
1a11c8b to
751ed42
Compare
4682df9 to
313c1ad
Compare
starr-openai
added a commit
that referenced
this pull request
May 4, 2026
## Why This stack adds configured exec-server environments, including environments reached over stdio. Before client-side stdio transports or config can use that path, the exec-server binary itself needs a first-class stdio listen mode so it can speak the same JSON-RPC protocol over stdin/stdout that it already speaks over websockets. **Stack position:** this is PR 1 of 5. It is the server-side transport foundation for the stack. ## What Changed - Accept `stdio` and `stdio://` for `codex exec-server --listen`. - Promote the existing stdio `JsonRpcConnection` helper from test-only code into normal exec-server transport code. - Add parse coverage for stdio listen URLs while preserving the existing websocket default. ## Stack - **1. This PR:** #20663 - Add stdio exec-server listener - 2. #20664 - Add stdio exec-server client transport - 3. #20665 - Make environment providers own default selection - 4. #20666 - Add CODEX_HOME environments TOML provider - 5. #20667 - Load configured environments from CODEX_HOME Split from original draft: #20508 ## Validation Not run locally; this was split out of the original draft stack. --------- Co-authored-by: Codex <noreply@openai.com>
3d9bb84 to
4c6d799
Compare
20d01c6 to
c0e9b77
Compare
7bc1d8f to
309db97
Compare
c0e9b77 to
863fffc
Compare
Let environment providers return an explicit default selection and let remote environments track the underlying transport instead of treating only websocket URLs as remote. This prepares the environment layer for stdio-backed remotes without introducing config-file loading. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Have providers return a concrete default environment id after constructing their environment map, using None to disable the default. This removes the DefaultEnvironmentSelection tri-state while preserving legacy derived defaults through the trait's default implementation. Co-authored-by: Codex <noreply@openai.com>
Make environment providers return the environment map and default id together. This keeps provider-owned startup state in one boundary and removes the separate default callback over a map. Co-authored-by: Codex <noreply@openai.com>
6b1d4ee to
2a16b0e
Compare
Remove the EnvironmentProviderSnapshot wrapper. Providers now expose environments and the selected default id directly, while EnvironmentManager validates that the default id exists in the returned environment map. Co-authored-by: Codex <noreply@openai.com>
Remove the private from_provider_parts helper. EnvironmentManager::from_provider now performs the provider read, validation, and manager construction directly, and tests use a small provider implementation instead of bypassing that path. 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.
Why
The next PR in this stack introduces configured environments, where the provider knows both which environments exist and which one should be selected by default. The existing manager derived the default internally by checking for the legacy
remoteandlocalids, and it treated "remote" as equivalent to "has a websocket URL." That does not work cleanly for stdio-command remotes because they are remote environments without anexec_server_url.Stack position: this is PR 3 of 5. It is the environment-model bridge between PR 2's transport enum and PR 4's TOML provider.
What Changed
DefaultEnvironmentSelectionto theEnvironmentProvidercontract:Derivedpreserves the oldremote-then-localfallback behavior.Environment(id)lets a provider explicitly select a configured default.Disabledlets a provider intentionally expose no default environment.CODEX_EXEC_SERVER_URL=nonedefault-disabling behavior intoDefaultEnvironmentProvider.EnvironmentManagervalidate explicit provider defaults and return an error if the selected id is missing.remote_transportseparately fromexec_server_urlso stdio-command environments are still recognized as remote.Environment::remote_stdio_shell_command(...)for the TOML provider added in the next PR.Stack
Split from original draft: #20508
Validation
Not run locally; this was split out of the original draft stack.