fix: avoid misleading same-model switch confirmations - #892
Open
yxlyx wants to merge 2 commits into
Open
Conversation
Compare resolved provider/model identity before announcing a switch. Keep explicit selection persistence and configuration refreshes, and let the legacy callback report provider-only changes. Allocate the callback result before changing selection so allocation failure does not contradict the displayed outcome. Add terminal, picker, callback, persistence, and allocation regressions plus an offline real-binary confirmation check in CI.
The preference fixture starts on the provider it explicitly selects. Assert that initial state and expect already-using wording while retaining the persistence and fallback checks.
yxlyx
marked this pull request as ready for review
September 14, 2026 08:49
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.
What changed
already usingwhen terminal commands or the model picker resolve to the active provider/model.Why
Successful selection does not necessarily mean a switch occurred. Compare resolved identity rather than query spelling or transport metadata. Keep selection application intact: skipping it would bypass saved preferences and configuration refreshes.
Verification
scripts/eval-tier1.sh— passed.zig build test -Dtest-filter="#890" --summary all— passed.zig build tui-test -Dtest-filter="model confirmation:" --summary all— passed.python3 scripts/test-model-confirmation.py zig-out/bin/graff— passed.python3 scripts/test-model-preference.py zig-out/bin/graff— passed.git diff --check— passed.Fixes #890.