openai / openai/codex

[Linux] apply_patch can create files but cannot update existing files (fs sandbox helper status 182)

Open
#45,618 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What issue are you seeing?

In a Codex workspace on Linux, apply_patch can create a new file but fails when updating that file or another existing file:

fs sandbox helper failed with status exit status: 182

This started today after the same workflow worked during the previous two days. Restarting Codex and reopening the workspace did not resolve it.

What steps can reproduce the bug?

  1. In a Linux Codex workspace, run an apply_patch operation that creates a temporary file containing before. This succeeds.
  2. Run an apply_patch operation that changes before to after in that file. This fails with status 182.
  3. Restart Codex or reopen the workspace and repeat the update. It still fails.

Observed in the same workspace:

  • sed can read existing files.
  • cp can write existing files.
  • apply_patch can create new files.
  • apply_patch fails only when updating an existing file.

What is the expected behavior?

apply_patch should be able to create, update, and delete files in the workspace. Updating an existing file should complete successfully.

Additional information

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 by reproducing the failure in the Linux fs sandbox helper through the apply_patch update path, using the create-then-update steps in the issue. Compare the update operation with the working create, sed, and cp cases to locate the failing boundary. Done means apply_patch can create, update, and delete files successfully in the reported workspace scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, rust
Domain
operating-systems, security, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.