Skip to content

Add CODEX_HOME environments TOML provider#20666

Merged
starr-openai merged 9 commits into
mainfrom
starr/exec-env-stdio-stack-4-toml-provider
May 8, 2026
Merged

Add CODEX_HOME environments TOML provider#20666
starr-openai merged 9 commits into
mainfrom
starr/exec-env-stdio-stack-4-toml-provider

Conversation

@starr-openai
Copy link
Copy Markdown
Contributor

@starr-openai starr-openai commented May 1, 2026

Why

After stdio transports and provider-owned defaults exist, Codex needs a config-backed provider that can describe more than the single legacy CODEX_EXEC_SERVER_URL remote. This PR adds that provider without activating it in product entrypoints yet, keeping parser/validation review separate from runtime wiring.

Stack position: this is PR 4 of 5. It builds on PR 3's provider/default model and adds the environments.toml provider used by PR 5.

What Changed

  • Add environment_toml.rs as the TOML-specific home for parsing, validation, and provider construction.
  • Keep the TOML schema/provider structs private; the public constructor added here is EnvironmentManager::from_codex_home(...).
  • Add TomlEnvironmentProvider, including validation for:
    • reserved ids such as local and none
    • duplicate ids
    • unknown explicit defaults
    • empty programs or URLs
    • exactly one of url or program per configured environment
  • Support websocket environments with url = "ws://..." / wss://....
  • Support stdio-command environments with program = "...".
  • Add helpers to load environments.toml from CODEX_HOME, but do not wire entrypoints to call them yet.
  • Add the toml dependency for parsing.

Stack

Split from original draft: #20508

Validation

Not run locally; this was split out of the original draft stack.

Documentation

This introduces the config shape for environments.toml; user-facing documentation should be added before this stack is treated as a documented public workflow.

@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from d2b7397 to 7eff29b Compare May 1, 2026 19:19
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from 2106226 to 50c4f0d Compare May 1, 2026 19:19
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from 7eff29b to 773f789 Compare May 1, 2026 19:37
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch 2 times, most recently from 0314e55 to d3e9d10 Compare May 1, 2026 19:54
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch 2 times, most recently from 387ab7a to 3fe0b35 Compare May 1, 2026 20:00
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch 2 times, most recently from 4fef0c4 to 40ebd87 Compare May 1, 2026 20:08
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from 66ec891 to f12eaed Compare May 1, 2026 20:35
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from 40ebd87 to 8be2149 Compare May 1, 2026 20:35
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from f12eaed to 56ada0d Compare May 1, 2026 20:39
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch 2 times, most recently from 18bb387 to 16a67b4 Compare May 1, 2026 20:39
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from 56ada0d to abde0bf Compare May 1, 2026 20:43
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from 16a67b4 to 4ba0ef0 Compare May 1, 2026 20:44
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from abde0bf to e0ff30e Compare May 1, 2026 21:02
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from 4ba0ef0 to 8898b25 Compare May 1, 2026 21:02
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from e0ff30e to 4682df9 Compare May 1, 2026 22:02
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from 8898b25 to 2fb7e79 Compare May 1, 2026 22:02
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from 4682df9 to 313c1ad Compare May 4, 2026 18:11
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from 2fb7e79 to 0eeddca Compare May 4, 2026 18:11
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>
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from 313c1ad to 20d01c6 Compare May 4, 2026 18:41
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from 0eeddca to a99c2c7 Compare May 4, 2026 18:41
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch 2 times, most recently from 8565584 to 7a171e1 Compare May 5, 2026 22:04
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from 3cb887e to e848a7b Compare May 5, 2026 22:16
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from 7a171e1 to ee9b735 Compare May 5, 2026 22:16
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from e848a7b to 60a8025 Compare May 5, 2026 22:39
@starr-openai starr-openai requested a review from a team as a code owner May 5, 2026 22:39
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from ee9b735 to 3ac2f68 Compare May 5, 2026 22:40
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from 60a8025 to 7d53449 Compare May 5, 2026 22:48
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from a57ea34 to 2a2f9c7 Compare May 5, 2026 22:48
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from 7d53449 to c40f7cb Compare May 5, 2026 22:53
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from 2a2f9c7 to dcdd3dd Compare May 5, 2026 22:54
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from c40f7cb to d5b28df Compare May 5, 2026 22:57
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from dcdd3dd to a53f5a5 Compare May 5, 2026 22:57
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from d5b28df to 5826053 Compare May 5, 2026 23:03
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch from a53f5a5 to e7c304e Compare May 5, 2026 23:03
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from 5826053 to 9f1de70 Compare May 6, 2026 18:42
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-4-toml-provider branch 2 times, most recently from f9c3d95 to cb14eac Compare May 6, 2026 19:04
@starr-openai starr-openai force-pushed the starr/exec-env-stdio-stack-3-env-model branch from b76f32a to a14098c Compare May 6, 2026 21:33
starr-openai and others added 9 commits May 7, 2026 18:04
Add the environments.toml schema, parser, validation, and provider implementation for configured websocket and stdio-command environments. This keeps the provider load helper available but does not make product entrypoints use it yet.

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Avoid keeping the test-only constructor in normal builds now that production construction uses the config-dir aware path.

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Make the environments.toml provider reachable from the exec-server crate API so the provider PR passes clippy before entrypoint wiring lands in the next stack PR.

Co-authored-by: Codex <noreply@openai.com>
Restore the transport-backed remote environment constructor used by the TOML provider so stdio-command environments are remote even though they do not have a websocket URL.

Co-authored-by: Codex <noreply@openai.com>
Expose EnvironmentManager::from_codex_home so the environments.toml provider is reachable before the entrypoint wiring PR lands.

Co-authored-by: Codex <noreply@openai.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants