Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad29119e25
ℹ️ 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".
| let permission_profile = permission_profile_override_from_config(config); | ||
| let sandbox = permission_profile | ||
| .is_none() | ||
| .then(|| sandbox_mode_from_policy(config.permissions.sandbox_policy.get().clone())) |
There was a problem hiding this comment.
Gate permission_profile overrides for remote app-server sessions
These lines always derive permission_profile from the local Config and then suppress sandbox, even when ThreadParamsMode::Remote is in use. In remote mode we already avoid forwarding local-only values like cwd/model_provider, but config.permissions.permission_profile() is runtime-expanded with local filesystem entries, so sending it to a remote app-server can apply client-local absolute paths and miss the server-side workspace carveouts it would normally derive. This affects thread/start, thread/resume, and thread/fork because they all share this override path.
Useful? React with 👍 / 👎.
0164ac6 to
853bd3b
Compare
536d5c4 to
c100e8e
Compare
ee0a15a to
a56ac61
Compare
929878c to
69ab9eb
Compare
## Why #18274 made `PermissionProfile` the canonical file-system permissions shape, but the round-trip from `FileSystemSandboxPolicy` to `PermissionProfile` still dropped one piece of policy metadata: `glob_scan_max_depth`. That field is security-relevant for deny-read globs such as `**/*.env`. On Linux, bubblewrap sandbox construction uses it to bound unreadable glob expansion. If a profile copied from active runtime permissions loses this value and is submitted back as an override, the resulting `FileSystemSandboxPolicy` can behave differently even though the visible permission entries look equivalent. ## What changed - Add `glob_scan_max_depth` to protocol `FileSystemPermissions` and preserve it when converting to/from `FileSystemSandboxPolicy`. - Keep legacy `read`/`write` JSON for simple path-only permissions, but force canonical JSON when glob scan depth is present so the metadata is not silently dropped. - Carry `globScanMaxDepth` through app-server `AdditionalFileSystemPermissions`, generated JSON/TypeScript schemas, and app-server/TUI conversion call sites. - Preserve the metadata through sandboxing permission normalization, merging, and intersection. - Carry the merged scan depth into the effective `FileSystemSandboxPolicy` used for command execution, so bounded deny-read globs reach Linux bubblewrap materialization. ## Verification - `cargo test -p codex-sandboxing glob_scan -- --nocapture` - `cargo test -p codex-sandboxing policy_transforms -- --nocapture` - `just fix -p codex-sandboxing` --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/18713). * #18288 * #18287 * #18286 * #18285 * #18284 * #18283 * #18282 * #18281 * #18280 * #18279 * #18278 * #18277 * #18276 * #18275 * __->__ #18713
3c66e19 to
e99a496
Compare
44c5e27 to
ea8eb64
Compare
1a9b5dc to
9d354ba
Compare
ab0e270 to
c013a96
Compare
0d7a36c to
c897233
Compare
Why
After app-server can accept
PermissionProfile, first-party clients should stop preferring legacy sandbox fields when they have canonical permission information available. This keeps the migration moving without removing legacy compatibility yet.What changed
This updates the exec and TUI app-server clients to send
permissionProfileoverrides derived from config, while preserving legacy sandbox fallback behavior when a profile is not available.Verification
cargo test -p codex-tui permissions -- --nocapturecargo test -p codex-core --test all permissions_messages -- --nocaptureStack created with Sapling. Best reviewed with ReviewStack.