Repository navigation
Conversation
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; Check diagnostics and launcher use the same environment precedence. Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; The sandbox uses the same environment precedence and private option stream. Co-Authored-By: Codex <noreply@openai.com>
…check-environment
There was a problem hiding this comment.
loopzero primary review by claude on 4ee56540c87951e2a08b57746ddb625724c403ab, 63.7s: approve (0 critical, 0 important, 3 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| options.seek(0) | ||
| fd = options.fileno() | ||
| return _proc.run( | ||
| [*prefix[:-1], "--args", str(fd), "--", *command], |
There was a problem hiding this comment.
suggestion: _run_bwrap silently relies on the prefix ending in "--"
[*prefix[:-1], "--args", ...] assumes the last element of prefix is the -- separator that bwrap_argv appends. If a caller passes a prefix built some other way, or bwrap_argv later adds anything after --, this would drop a real argument without any error. A check-mode prefix is also unusable without _run_bwrap: it has --clearenv but no --setenv, so a direct [*prefix, cmd] launch would run with an empty environment and no PATH. Smallest fix: assert prefix[-1] == "--", or have bwrap_argv return the options without the trailing -- and let _run_bwrap add it.
| probe = _proc.run( | ||
| [*prefix, "true"], cwd=worktree, env_allowlist=config.env_allowlist, timeout=GIT_TIMEOUT | ||
| ) | ||
| probe = _run_bwrap(config, worktree, prefix, ("true",), timeout=GIT_TIMEOUT) |
There was a problem hiding this comment.
suggestion: Reviewer namespace probe now differs from the real reviewer launch
runners._sandbox_prefix calls sandbox.probe with a reviewer prefix built with clearenv=False, which already carries --setenv arguments. Because probe now goes through _run_bwrap, the reviewer probe also gets an --args stream built from check_environment(review_config), which adds check defaults such as UV_CACHE_DIR. Its host launcher also gets only PATH, while the real reviewer launch gets BASE_ENV. Running true makes this harmless today, but it undercuts the docstring's claim that the probe tests 'the exact sandbox we will use', and reviewers now set environment through two channels. Consider giving probe a flag, or letting the reviewer path call _proc.run directly as before.
| # Apply settings inside bwrap without exposing the option stream in argv. | ||
| with tempfile.TemporaryFile() as options: | ||
| for name, value in check_environment(config).items(): | ||
| if "\0" in value: |
There was a problem hiding this comment.
suggestion: Null-byte check covers values but not names
_run_bwrap rejects values that contain NUL but writes names without checking them. A config.env key containing \0, or =, would shift the NUL-separated option stream and corrupt the options bwrap parses. Before this change, subprocess rejected such names when building argv. Validate name the same way as value.
|
Parked at approved head |
…check-environment
|
Superseded by #1427. Main added newline-preserving subprocess output, which conflicts with the reviewed descriptor plumbing in |
Keep check environment values out of launcher arguments
Context and goal
Closes #1029
Acceptance
Notes
Pass the filtered environment through Bubblewrap's file-descriptor option stream. Keep environment clearing inside Bubblewrap so config variables cannot affect the host launcher. Use a private file per launch to avoid shared offsets across probes and checks.
Local validation
Head b9abb58 passed all 75 sandbox tests, including the namespace and alternate probes.
Base
Base: a4fa169
Delivery boundary
Head e833fd1 passed all 83 sandbox tests. The branch preserves main's pipeline exit behavior. It is ready for a fresh base merge and gate after #1027 lands.
Validation
Recorded for
5120c98819aeuv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review