Skip to content

Switch runtime to cloud config bundle#24622

Open
joeflorencio-openai wants to merge 5 commits into
dev/joeflorencio/cloud-config-bundle-transportfrom
dev/joeflorencio/switch-runtime-cloud-config-bundle
Open

Switch runtime to cloud config bundle#24622
joeflorencio-openai wants to merge 5 commits into
dev/joeflorencio/cloud-config-bundle-transportfrom
dev/joeflorencio/switch-runtime-cloud-config-bundle

Conversation

@joeflorencio-openai
Copy link
Copy Markdown

@joeflorencio-openai joeflorencio-openai commented May 26, 2026

Summary

PR 5 of 5 in the cloud-managed config client stack.

Switches runtime config loading over to the unified cloud config bundle, wires all managed requirements sources through the shared requirements-layer composer, and removes the legacy codex-cloud-requirements runtime path.

Details

  • Runtime mental model: config construction receives one CloudConfigBundleLoader, and both cloud-delivered requirements and cloud-delivered config layers are read from that same snapshot.
  • Requirements from system requirements.toml, cloud bundle fragments, legacy managed_config.toml, and MDM are normalized into lowest-to-highest precedence RequirementsLayers before composition, matching config-layer ordering.
  • This is the point where the PR 2 composition semantics become the canonical requirements merge path, rather than applying only to cloud-delivered fragments.
  • Bundle-delivered config uses the layer provenance and diagnostics from PR 3; bundle-delivered requirements use the shared composer from PR 2.
  • Requirements hook provenance is renamed from cloud requirements to managed requirements because these hooks may now originate from non-cloud managed requirements layers.
  • This keeps v1 conservative: loading remains pull-based and startup/session snapshot-oriented, with no dynamic reload behavior for already-running sessions.
  • Cloud bundle load failures are surfaced as cloudConfigBundle errors, with auth-related failures classified for relogin handling.

Validation

Local validation:

  • just fmt
  • cargo check -p codex-config
  • just test -p codex-config requirements_composition
  • git diff --check

CI will run the broader test matrix.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@joeflorencio-openai
Copy link
Copy Markdown
Author

recheck

@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from f9a036b to 7f490c5 Compare May 26, 2026 20:20
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch 2 times, most recently from 33f45ee to 78a0d84 Compare May 26, 2026 20:32
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch 2 times, most recently from 9f9cea6 to d38594c Compare May 26, 2026 20:46
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from 78a0d84 to 438e65e Compare May 26, 2026 20:46
@joeflorencio-openai joeflorencio-openai marked this pull request as ready for review May 26, 2026 21:32
@joeflorencio-openai joeflorencio-openai requested a review from a team as a code owner May 26, 2026 21:32
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from 438e65e to 194afd0 Compare May 26, 2026 21:37
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 438e65ef09

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/config/src/loader/mod.rs Outdated
Comment thread codex-rs/exec/src/lib.rs
Comment thread codex-rs/config/src/loader/mod.rs Outdated
Comment thread codex-rs/tui/src/lib.rs Outdated
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch 2 times, most recently from dc90f07 to da8a6d7 Compare May 28, 2026 19:52
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch 2 times, most recently from cc9ec27 to fae0096 Compare May 28, 2026 20:52
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from da8a6d7 to 4b922aa Compare May 28, 2026 20:52
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from fae0096 to ccc0c6a Compare May 28, 2026 20:56
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from 4b922aa to b14d255 Compare May 28, 2026 20:56
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from ccc0c6a to ee9df4f Compare May 28, 2026 21:49
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from b14d255 to 81a9b2c Compare May 28, 2026 21:49
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from ee9df4f to 1f13fcf Compare May 28, 2026 22:11
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch 2 times, most recently from 2d4d4ea to f2b36ab Compare May 28, 2026 22:20
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from 1f13fcf to 4333622 Compare May 28, 2026 22:20
@joeflorencio-openai
Copy link
Copy Markdown
Author

@codex review

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2b36ab920

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/config/src/loader/mod.rs Outdated
Comment thread codex-rs/app-server-protocol/src/protocol/v2/hook.rs Outdated
Comment thread codex-rs/tui/src/lib.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/config_errors.rs
Comment thread codex-rs/config/src/loader/mod.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/config_errors.rs
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from 4333622 to be7117f Compare May 28, 2026 23:54
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from f2b36ab to bd5f010 Compare May 28, 2026 23:54
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from be7117f to c4f0868 Compare May 29, 2026 00:21
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from bd5f010 to 5fb048c Compare May 29, 2026 00:22
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from c4f0868 to 8aa8462 Compare May 29, 2026 00:37
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch 3 times, most recently from 0415e4e to 86ae66f Compare May 29, 2026 01:25
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from 86ae66f to db4846e Compare May 29, 2026 20:46
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch 2 times, most recently from 6d266b1 to f30ddc5 Compare May 29, 2026 22:40
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from db4846e to 07cdfd2 Compare May 29, 2026 22:40
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from f30ddc5 to c1c5625 Compare May 29, 2026 23:02
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from b00a469 to e440aa1 Compare May 29, 2026 23:03
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from c1c5625 to 01afd43 Compare May 29, 2026 23:13
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from e440aa1 to 1eccaba Compare May 29, 2026 23:13
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from 01afd43 to aec42eb Compare May 29, 2026 23:22
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from 1eccaba to cded23d Compare May 29, 2026 23:22
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from aec42eb to 01df562 Compare May 30, 2026 00:12
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from cded23d to 6993648 Compare May 30, 2026 00:13
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from 01df562 to 36ebbd0 Compare May 30, 2026 00:19
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from 6993648 to 2f9b084 Compare May 30, 2026 00:20
Replace the old cloud requirements runtime path with the unified cloud config bundle loader. Config construction now receives a CloudConfigBundleLoader and uses the shared bundle for both cloud-delivered requirements and cloud-delivered config layers, so config and requirements consumers do not race separate backend fetches.

Remove the codex-cloud-requirements crate and legacy CloudRequirementsLoader surface. The new path preserves the existing pull-based load behavior and routes managed requirements through the same composed requirements model while enterprise-managed config fragments are inserted below user/profile/project/session config and above system config. Legacy MDM-delivered managed_config.toml remains the highest-precedence compatibility layer while it is phased out.

Thread the bundle loader through app-server, app-server-client, TUI, core config construction, exec, hooks, network proxy loading, and related tests. Update config-manager error handling and tests to report cloudConfigBundle load failures consistently, and update the loader README to describe the new public argument and the effective config-layer precedence.

Refresh generated Python SDK protocol artifacts from the local app-server schema so downstream clients know about enterpriseManaged config layers and the cloudManagedConfig hook source. The normal SDK generate-types command still targets the pinned runtime package, so this checkpoint regenerated v2_all.py from the checked-in local schema for the branch-local protocol changes.

Add codex_config::test_support::CloudConfigBundleFixture to centralize cloud bundle test setup. The fixture supports quick single-layer enterprise requirement/config loaders, additive enterprise requirement/config layers for multi-layer tests, and conversion into either a bundle or loader, removing copied private helpers from core and app-server tests.

Verification: just fmt; just fix -p codex-config; cargo test -p codex-config test_support; cargo test -p codex-core cloud_config_bundle_take_precedence_over_mdm_requirements; cargo test -p codex-app-server write_value_rejects_feature_requirement_conflict; git diff --cached --check. Earlier checkpoint verification also covered codex-cloud-config, codex-backend-client, codex-hooks, codex-core-plugins, selected codex-core cloud config tests, selected codex-app-server cloud config tests, bazel lock update/check, and a Python SDK smoke test for enterpriseManaged and cloudManagedConfig.
Move CloudConfigBundleLoader into ConfigLoadOptions so lower-level config loading does not need a separate bundle parameter or a bundle-specific TOML helper.

Keep exec and TUI on the straightforward local helper path: bootstrap from local config, build the shared cloud bundle loader, and reload merged TOML with that loader only when OSS provider inference needs cloud-delivered config.

Preserve strict validation and path-base behavior for cloud config and requirements fragments, including diagnostics that name the cloud layer and requirements paths resolved against CODEX_HOME.

Validation: just fmt; just test -p codex-core -E 'test(load_config_layers_resolves_relative_cloud_requirements_paths_against_codex_home) | test(strict_config_rejects_unknown_cloud_config_key)'; just test -p codex-config; just test -p codex-exec -E 'test(top_cli_parses_resume_prompt_after_config_flag)'; just test -p codex-tui -E 'test(app_server_target_for_launch_prefers_explicit_remote_endpoint)'; just fix -p codex-config -p codex-core -p codex-exec -p codex-tui -p codex-app-server -p codex-core-plugins; git diff --check.
Adapts the runtime config loading call sites to the RequirementsLayerEntry name introduced by the requirements composition PR. This keeps the final config-bundle runtime switch aligned with the renamed layer-entry abstraction while preserving the existing loading semantics.
Keeps the cloud config bundle fixture module focused by moving its unit tests into a named sibling test file. This mirrors the test organization used by the cloud config modules and avoids putting implementation and test bodies in the same file.
Updates the remaining legacy cloud requirements test-builder call to use the cloud config bundle loader helper. This fixes the top PR Bazel/clippy failure after removing the old cloud requirements path.
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/cloud-config-bundle-transport branch from 36ebbd0 to a919f8f Compare May 30, 2026 00:24
@joeflorencio-openai joeflorencio-openai force-pushed the dev/joeflorencio/switch-runtime-cloud-config-bundle branch from 2f9b084 to ce00443 Compare May 30, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant