Skip to content

fix: propagate JSON parse error instead of silently overwriting Gemini settings - #3503

Open
mmustafasenoglu wants to merge 1 commit into
rtk-ai:developfrom
mmustafasenoglu:fix/gemini-settings-overwrite
Open

fix: propagate JSON parse error instead of silently overwriting Gemini settings#3503
mmustafasenoglu wants to merge 1 commit into
rtk-ai:developfrom
mmustafasenoglu:fix/gemini-settings-overwrite

Conversation

@mmustafasenoglu

Copy link
Copy Markdown

Fixes #3400

The Gemini installer used .unwrap_or(serde_json::json!({})) which swallows JSON parse errors (BOM, trailing commas, half-written files) and silently overwrites the user's entire ~/.gemini/settings.json with an empty object.

The Claude, Cursor, and Droid installers all use .with_context()? to propagate the error. This applies the same pattern to the Gemini path so the install fails loudly with the path and the parse error instead of overwriting.

…i settings

The Gemini installer used .unwrap_or(serde_json::json!({})) which swallows
parse errors (BOM, trailing commas, half-written files) and overwrites the
user's entire settings.json with an empty object.

The Claude, Cursor, and Droid installers all use .with_context()? to propagate
the error. This applies the same pattern to the Gemini path.

Closes rtk-ai#3400
Copilot AI lite review requested due to automatic review settings August 9, 2026 19:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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 silently replaces the user's entire ~/.gemini/settings.json if it fails to parse, with no backup

2 participants