Remove the network proxy config wrapper (#31767)

## Why

`NetworkProxyConfig` only wrapped `NetworkProxySettings` in a single
`network` field. That extra level made runtime callers repeat `.network`
everywhere without representing a real boundary.

## What changed

- move the managed-network fields directly onto `NetworkProxyConfig`
- collapse the matching partial-config wrapper
- update runtime callers and tests to use the direct fields
- keep the user-facing permissions/profile TOML layout unchanged

The internal serialized shape now matches the runtime type itself. This
does not change managed-network behavior or the `config.toml` shape.
This commit is contained in:
jif authored and GitHub committed 2026-07-09 17:33:37 +01:00
1 parent f46b53bd85
commit cf6d8ad921
25 files changed
+428 -632

No files matched your search

@@ -220,7 +220,7 @@ fn network_toml_overlays_unix_socket_permissions_by_path() {
.apply_to_network_proxy_config(&mut config);
assert_eq!(
config.network.unix_sockets,
config.unix_sockets,
Some(codex_network_proxy::NetworkUnixSocketPermissions {
entries: BTreeMap::from([
(
@@ -399,7 +399,7 @@ fn profile_network_proxy_config_keeps_proxy_disabled_for_bare_network_access() {
..Default::default()
}));
assert!(!config.network.enabled);
assert!(!config.enabled);
}
#[test]
@@ -417,11 +417,11 @@ fn profile_network_proxy_config_keeps_proxy_disabled_for_proxy_policy() {
..Default::default()
}));
assert!(!config.network.enabled);
assert_eq!(config.network.proxy_url, "http://127.0.0.1:43128");
assert!(!config.network.enable_socks5);
assert!(!config.enabled);
assert_eq!(config.proxy_url, "http://127.0.0.1:43128");
assert!(!config.enable_socks5);
assert_eq!(
config.network.domains,
config.domains,
Some(codex_network_proxy::NetworkDomainPermissions {
entries: vec![codex_network_proxy::NetworkDomainPermissionEntry {
pattern: "openai.com".to_string(),