Skip to content

Preserve editor files when saving fails - #2

Draft
lukisch wants to merge 3 commits into
mainfrom
fix/codex-editor-save-safety-20261002
Draft

lukisch wants to merge 3 commits into
mainfrom
fix/codex-editor-save-safety-20261002

Conversation

@lukisch

@lukisch lukisch commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

An interrupted editor save could truncate an existing file before returning an error. Invalid UTF-8 could also escape the save boundary after the target was opened. Both failures were reproduced on unchanged main at 4116f36.

EditorTab now encodes the full buffer as strict UTF-8 with native newlines before opening the target, then writes through Qt QSaveFile with direct-write fallback disabled. It checks open, byte count and final commit; on failure it cancels the temporary write, reports the error and keeps the document dirty. Existing SaveAs, Close and Run guards remain in place.

This branch also repairs CI issues exposed by the full suite: test jobs install Pillow; platform smoke tests use the selected interpreter and named debug argument and expose the terminal process error signal; a tomli fallback preserves metadata parsing on Python 3.10.

Validation:

  • Current HEAD 56bf06b: all 13 GitHub Actions jobs passed, covering lint and Windows/Linux/macOS on Python 3.10–3.13.
  • The unchanged 4116f36 full suite passed 346 tests with 1 skip. Candidate d528a85 passed 353 with 1 skip. Current HEAD is validated by CI; no separate final-head local full-suite run was started.
  • 16 focused save tests and 69 tests against the final OneDrive overlay passed. Independent save review passed 25 cases; one native symlink case was skipped because Windows returned error 1314. Platform and metadata deltas received separate reviews.
  • Hash readback covered all 173 tracked OneDrive paths. All 11 owned overlay files match this branch; 25 foreign deltas and the existing .git remain intact. The private config/settings.json was excluded from the isolated snapshot.

Version remains 0.3.5. No executable was built and no release was made. This remains Draft PR #2; merge still requires the separate review gate for a different model class.

Signed-off-by: Lukas Geiger <lukas@um-bruch.org>
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Welcome! 👋 Thanks for your first pull request in this repository.

A maintainer will review it soon. Please make sure:

  • Your changes are tested
  • Documentation is updated if needed
  • The PR description explains what and why

Thanks for contributing!

Lukas Geiger added 2 commits October 2, 2026 03:54
Signed-off-by: Lukas Geiger <lukas@um-bruch.org>
Signed-off-by: Lukas Geiger <lukas@um-bruch.org>
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