Skip to content

feat: add managed network proxy feature flag#20147

Draft
viyatb-oai wants to merge 1 commit intomainfrom
codex/viyatb/network-proxy-feature
Draft

feat: add managed network proxy feature flag#20147
viyatb-oai wants to merge 1 commit intomainfrom
codex/viyatb/network-proxy-feature

Conversation

@viyatb-oai
Copy link
Copy Markdown
Collaborator

@viyatb-oai viyatb-oai commented Apr 29, 2026

Why

The permissions migration is making permissions.<profile>.network.enabled the canonical sandbox network bit, but managed proxy startup is a different concern. Enabling direct network access should not implicitly start the proxy, and users who are still on legacy sandbox modes need a separate place to opt into proxy startup and provide proxy-specific settings.

This follow-up to #19900 gives the managed proxy its own feature surface instead of overloading permission-profile network semantics.

What changed

  • Add an experimental network_proxy feature with a configurable [features.network_proxy] table.
  • Teach CLI feature toggles to preserve configurable feature tables by writing features.<name>.enabled rather than replacing the whole table.
  • Overlay features.network_proxy settings onto the configured proxy state after permission-profile selection, so the feature can start the managed proxy without changing the active NetworkSandboxPolicy.
  • Preserve managed [experimental_network] startup behavior independently of the new feature flag.

Relevant code:

Verification

Added focused coverage for:

  • starting the managed proxy from features.network_proxy without enabling sandbox network access
  • merging CLI overrides into the feature config table
  • preserving managed [experimental_network] startup without the feature
  • reusing profile-supplied proxy settings when the feature is enabled

Ran:

  • cargo test -p codex-features
  • cargo test -p codex-core network_proxy_feature
  • cargo test -p codex-core experimental_network_requirements_enable_proxy_without_feature
  • cargo test -p codex-cli feature_toggles_preserve_configurable_feature_tables

@viyatb-oai viyatb-oai requested a review from a team as a code owner April 29, 2026 05:55
@viyatb-oai viyatb-oai marked this pull request as draft April 29, 2026 05:58
@viyatb-oai viyatb-oai changed the title feat: add network proxy feature flag feat: add managed network proxy feature flag Apr 29, 2026
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: 94f65a149e

ℹ️ 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".


fn network_proxy_toml_config(features: Option<&FeaturesToml>) -> Option<&NetworkProxyConfigToml> {
match features?.network_proxy.as_ref()? {
FeatureToml::Enabled(_) => None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Badge Honor explicit network_proxy = false in profile overrides

network_proxy_toml_config ignores FeatureToml::Enabled(false), so a profile-level disable does not clear base [features.network_proxy] table settings. Because config merging later only forces enabled = true (never false), a root table with enabled = true can still start the managed proxy even when the active profile sets network_proxy = false.

Useful? React with 👍 / 👎.

Comment on lines +2182 to +2184
if let Some(network_proxy) = network_proxy_toml_config(cfg.features.as_ref()) {
apply_network_proxy_feature_config(&mut configured_network_proxy_config, network_proxy);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Badge Prevent feature disable from suppressing profile proxy behavior

Applying [features.network_proxy] config directly onto configured_network_proxy_config lets enabled = false override proxy settings derived from active [permissions] profiles. With --disable network_proxy now writing features.network_proxy.enabled=false, this can turn off a proxy that profile network policy would otherwise start, contradicting the goal to preserve existing managed proxy startup behavior.

Useful? React with 👍 / 👎.

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