Skip to content

fix(gemini): validate settings before removing hook files - #5244

Open
Aschenbath wants to merge 1 commit into
rtk-ai:developfrom
Aschenbath:fix/oss40-20261124-928f-rtk-gemini-uninstall-json
Open

Aschenbath wants to merge 1 commit into
rtk-ai:developfrom
Aschenbath:fix/oss40-20261124-928f-rtk-gemini-uninstall-json

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

rtk init -g --gemini --uninstall currently deletes the hook and GEMINI.md, then silently ignores malformed settings.json. Parse and update the settings before removing either artifact, and return a contextual error if the file cannot be read or parsed. Use the same atomic settings replacement as installation so a failed write also leaves the hook available.

Fixes #3400. This addresses the remaining uninstall failure described in the issue.

Validation: the real-process regression first failed because uninstall exited successfully and removed both artifacts. It now checks empty, truncated and trailing-comma JSON in normal and dry-run modes, with byte-for-byte preservation of settings and installed files. Existing successful uninstall coverage also passes. cargo fmt --all --check, proxy formatting, cargo clippy --all-targets and cargo test --all passed.

Prepared with Codex assistance.

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.

rtk init --gemini --uninstall silently skips an unparsable settings.json and leaves a dangling hook entry

1 participant