Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--forcefor non-interactive wallet resets in JSON modeProblem
Declining
wallet resetreturned exit status 0 and mixed a plain-text prompt and abort message into JSON output. Automation could interpret the reset as completed and could not parse the documented JSON result.Approach
JSON mode rejects reset without
--forcebefore prompting. Interactive table mode still prompts, but a negative response now returns an error. Forced JSON resets retain the existing successful deletion behavior.Tests
cargo +1.91.1 fmt --checkcargo +1.91.1 clippy --locked --all-targets -- -D warningsgit diff --checkRisk
Low. The only compatibility change is that declined destructive operations are no longer reported as success.
Fixes #98
Note
Low Risk
Behavior change is limited to wallet reset exit codes and JSON output; declined resets no longer report success, which is the intended fix for automation.
Overview
wallet resetnow treats declined or non-forced destructive runs as failures instead of success, so scripts and humans get a clear signal when nothing was deleted.In JSON mode, reset without
--forcefails immediately with a single structured JSON error (no interactive prompt mixed into stdout). Table mode still prompts, but answering no returns a nonzero exit with Aborted on stderr viabail!, and config is left intact in both cases. Forced JSON reset behavior is unchanged.Integration tests add an isolated
TestHomefixture and cover JSON-without-force, table decline, and forced JSON success paths.Reviewed by Cursor Bugbot for commit 620bc80. Bugbot is set up for automated code reviews on this repo. Configure here.