codex
codex copied to clipboard
[codex] Add managed field support to requirements.toml
Overview
Adds requirements.toml enforcement for managed authentication, storage, telemetry, shell, feedback, and Windows settings.
Config layers provide values; requirements enforce invariants. This PR does not remove or migrate managed_config.toml, and it does not make every config.toml field enforceable.
Semantics
| Requirement | Behavior |
|---|---|
allowed_login_methods |
Merges by key, with false as a deny tombstone. Intersects with forced_login_method. Unknown methods, conflicts, or denying every method fail startup closed. |
allowed_chatgpt_workspaces |
Merges by workspace ID, with false removing an ID. Intersects with forced_chatgpt_workspace_id; an empty result denies ChatGPT workspace auth. Existing API key, Bedrock, and PAT exemptions remain unchanged. Blank IDs are rejected. |
cli_auth_credentials_store, chatgpt_base_url |
Higher-priority requirement wins and replaces ordinary config. Local requirements are applied during bootstrap so they control the credentials and endpoint used to fetch cloud requirements. |
sqlite_home, log_dir, model_catalog_json, check_for_update_on_startup, allow_login_shell |
Higher-priority exact value wins and replaces ordinary config. Path requirements do not migrate existing data. |
| OTEL scalar and exporter settings | Required leaves replace matching config leaves; omitted leaves remain configurable. Each exporter is atomic, so endpoint, protocol, TLS, and headers cannot be combined across sources. |
otel.span_attributes, otel.tracestate |
Maps merge recursively. Required keys win while unrelated configured keys survive when valid. Invalid required metadata fails startup; invalid configured tracestate additions are ignored with a warning without erasing required metadata. |
shell_environment_policy |
Nested leaves merge recursively. Present requirement leaves are exact; omitted leaves remain configurable. |
feedback.enabled, windows.sandbox_private_desktop |
Exact nested leaves that replace matching ordinary config. |
Conflicting ordinary config values are overridden and surfaced as startup warnings. Requirement source provenance is preserved through composition and validation errors.
configRequirements/read exposes the new fields, including complete OTEL exporter configuration and headers.
Validation
Coverage includes:
- requirement-layer composition and source provenance
- authentication intersections and fail-closed behavior
- bootstrap credential-store and base-URL enforcement
- exact and nested config overrides
- OTEL exporter atomicity and trace metadata validation
- app-server serialization and generated schema fixtures