Skip to content

fix(files): stop writes when reading existing content fails - #2584

Merged
jonathanKingston merged 1 commit into
mainfrom
codex/preserve-files-on-read-error
Sep 9, 2026
Merged

jonathanKingston merged 1 commit into
mainfrom
codex/preserve-files-on-read-error

Conversation

@jonathanKingston

Copy link
Copy Markdown
Collaborator

write_file and approval-time writes currently treat every read failure as an empty/missing file. If an existing local file cannot be read, its contents can be overwritten without the stale-content guard checking them.

Only a missing-file error may take the new-file path. Other errors stop the tool or return an apply error before writing. Regression tests inject EACCES and EIO and verify the existing bytes survive; existing new-file tests cover the permitted path.

Validation: pnpm run check. Both read-failure regressions fail on current main. File I/O handling only; approval policy, hooks, DOM, and layout are unchanged.

github-actions Bot added a commit that referenced this pull request Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🖥️ PR preview

@copse-release-bot

Copy link
Copy Markdown
Contributor

Reference screenshots ready for review

Review GitHub’s image diffs in screenshot PR #2586.
Merge it (or enable auto-merge) to apply the accepted PNGs to codex/preserve-files-on-read-error.

Rendered for 3122762e488a by CI run 34250393001; the immutable artifact is reference-screenshot-candidates-34250393001.

If this source branch moves, a later successful render closes the stale review PR and replaces this link.

@jonathanKingston
jonathanKingston merged commit 2c8a5a8 into main Sep 9, 2026
40 of 42 checks passed
@jonathanKingston
jonathanKingston deleted the codex/preserve-files-on-read-error branch September 9, 2026 00:31
github-actions Bot added a commit that referenced this pull request Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant