Repository navigation
fix(setup): preserve initial backups and Codex comments - #1204
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99fe64ac48
ℹ️ 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".
| "failed", | ||
| "Configuration could not be backed up, so no change was made. Check file permissions, then rerun uninstall.", | ||
| ); | ||
| if (!(cause instanceof Error && "code" in cause && cause.code === "EEXIST")) |
There was a problem hiding this comment.
Keep a current recovery copy before uninstalling
When setup has already created .rea.backup, this EEXIST path proceeds without preserving the configuration captured in original. If uninstall then updates the file but its restoration also fails, the remediation at line 321 points to a pre-setup snapshot that omits any settings the user changed afterward, so following it can lose those changes. Preserve the first snapshot separately while creating a fresh uninstall-recovery copy, or fail before mutation when the current state cannot be recovered.
AGENTS.md reference: AGENTS.md:L7-L12
Useful? React with 👍 / 👎.
| * Replace REA's TOML server tables and assignments. Comments that introduce a | ||
| * following table stay. Text inside strings is not treated as a header. Only | ||
| * Grok Build reads the root `disabled_mcp_servers` list that registration | ||
| * also edits. | ||
| * following table stay. Codex also retains comments around REA's own table. | ||
| * Text inside strings is not treated as a header. Only Grok Build reads the |
There was a problem hiding this comment.
Preserve inline comments on removed Codex statements
The new preservation behavior only retains standalone # lines. For a valid Codex entry such as [mcp_servers.rea] # local setup notes or command = "old" # explanation, the header and assignment branches discard the entire physical line, including the comment, during setup or uninstall. Retain the comment suffix before dropping those statements, or narrow this newly documented preservation guarantee.
AGENTS.md reference: AGENTS.md:L53-L57
Useful? React with 👍 / 👎.
N0zoM1z0
left a comment
There was a problem hiding this comment.
Reviewed backup retention and rollback paths against the merged #1178 fix. All 125 focused tests, the installed-package lifecycle verifier, and all 22 final-head CI checks pass; comments, symlinks, and the first backup survive setup/uninstall. Ready to merge.
Follow-up to #1163 and #1178. Uninstall still discarded comment-only Codex configuration and overwrote the original
.rea.backupwith the installed registration, making the first configuration snapshot unavailable.Preserve Codex comments when removing or replacing REA tables and keep the first backup across setup, uninstall, and later setup. A failed uninstall restores the captured current configuration while retaining that original backup. Other TOML clients keep their existing editing behavior.
Validation:
npm run build:cachedandnpm run check:fastpass.node scripts/verify-package.mjspasses against the installed tarball: CLI/MCP, four clients, exact Codex text round trip, initial backup retention, symlinks, and failure recovery; no surviving verifier descendants. Run with a temporary root outside the repository and no injected Ghidra/IDA configuration.Configuration-only change. Real Hopper/Ghidra execution was not performed for this PR; packaged provider checks use the existing verifier fixtures.