openai / openai/codex

FreeBSD: apply_patch can create files but update/delete fail because filesystem sandbox cannot be enforced

Open
#45,538 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug CLI sandbox tool-calls
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

Summary

On FreeBSD 14.4, the built-in apply_patch tool can create a new file, but it cannot update or delete an existing file. Update and delete fail during patch verification with:

apply_patch verification failed: Failed to read file to update /usr/home/codex/nrt-cli/.codex-apply-patch-probe: filesystem sandbox cannot be enforced on this executor

For delete:

apply_patch verification failed: Failed to read /usr/home/codex/nrt-cli/.codex-apply-patch-probe: filesystem sandbox cannot be enforced on this executor
Environment
  • OS: FreeBSD 14.4-RELEASE-p9 amd64
  • Filesystem: local UFS (/dev/da0a), not NFS
  • Codex CLI: reproduced on 0.149.0_1 and again after updating to 0.153.4
  • Package: FreeBSD binary package misc/codex
  • Workspace: /usr/home/codex/nrt-cli
  • Home: canonical /usr/home/codex
  • /home is a system symlink to usr/home, but neither the configured home nor workspace path uses that symlink
  • Workspace owner: codex:codex
  • Project trust: trusted
  • Execution mode: Codex desktop remote app-server / code-mode host with managed workspace-write permissions
Reproduction
  1. Start Codex with a trusted workspace on local UFS.
  2. Apply an Add File patch:
*** Begin Patch
*** Add File: .codex-apply-patch-probe
+create-ok
*** End Patch

This succeeds and creates the file.

  1. Apply an Update File patch:
*** Begin Patch
*** Update File: .codex-apply-patch-probe
@@
-create-ok
+update-ok
*** End Patch

This fails with filesystem sandbox cannot be enforced on this executor.

  1. Apply a Delete File patch:
*** Begin Patch
*** Delete File: .codex-apply-patch-probe
*** End Patch

This fails with the same error.

Expected behavior

Add, update, and delete operations all work for files inside the configured writable workspace.

Troubleshooting already performed
  • Completely terminated all running Codex processes before restarting.
  • Recreated ~/.codex from scratch.
  • Changed the account home to the canonical non-symlink path /usr/home/codex.
  • Confirmed the workspace resolves directly to /usr/home/codex/nrt-cli.
  • Confirmed correct ownership and permissions.
  • Confirmed the project is marked trusted.
  • Updated Codex from 0.149.0_1 to 0.153.4 and reproduced again.
  • Shell-based reads, writes, and deletion in the same workspace work normally.
Additional evidence

The app-server log records the failure in codex_core::tools::router:

ERROR codex_core::tools::router: error=apply_patch verification failed: Failed to read file to update /usr/home/codex/nrt-cli/.codex-apply-patch-probe: filesystem sandbox cannot be enforced on this executor

The asymmetry suggests that creation does not require the same pre-read verification path, while update/delete invoke a filesystem sandbox helper that is unavailable or considered unenforceable on the FreeBSD executor.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the codex_core::tools::router apply_patch verification path described by the app-server log, then compare how Add File differs from Update File and Delete File on the FreeBSD executor. Reproduce the three operations in the reported workspace and verify that creation, update, and deletion all work without the filesystem sandbox error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.