Resolve Linux sandbox mode once before launching the helper (#62215)

## Why

Managed proxy routes require bubblewrap's network namespace even when
`features.use_legacy_landlock` is enabled. WSL1 compatibility checks and
helper arguments need to agree on the effective mode.

## What changed

Resolve bubblewrap or legacy Landlock once and use that mode for both the
WSL1 check and the `codex-linux-sandbox` arguments. Use Linux sandbox
naming for the shared launcher and CLI code, and preserve the published
analytics category for a missing helper executable.

## Testing

Unit tests exercise the production argument builder, including managed
network context serialization when legacy Landlock is requested. They
also cover which sandbox configurations WSL1 accepts and rejects.

GitOrigin-RevId: 619ab9d3eef965de6bc6cb13ff8a33132018abcf
This commit is contained in:
viyatb-oai
2026-11-18 07:23:25 +00:00
committed by copyberry
parent ba8ab2d050
commit bcff988bd1
26 changed files with 301 additions and 360 deletions
+1 -1
View File
@@ -1056,7 +1056,7 @@ async fn augment_mcp_tool_request_meta_with_sandbox_state(
return Ok(meta);
};
// TODO(anp): Build this metadata from the server's captured
// TurnEnvironment::sandbox_context instead of the runtime-wide Landlock value.
// TurnEnvironment::sandbox_context instead of the runtime-wide legacy Landlock setting.
prepared_call
.augment_sandbox_metadata(
&mut meta,