Skip to content

fix: avoid misleading same-model switch confirmations - #892

Open
yxlyx wants to merge 2 commits into
mainfrom
fix/890-model-confirmation
Open

fix: avoid misleading same-model switch confirmations#892
yxlyx wants to merge 2 commits into
mainfrom
fix/890-model-confirmation

Conversation

@yxlyx

@yxlyx yxlyx commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Report already using when terminal commands or the model picker resolve to the active provider/model.
  • Distinguish provider-only changes in the legacy callback, and allocate its result before changing the selection.
  • Add regressions for aliases, repeated selections, real changes, persistence, configuration refreshes, failures, and picker behavior. Run an offline real-binary confirmation regression in CI.
  • Update the preference regression to assert its initial selection and expect unchanged-selection wording.

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.

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
yxlyx marked this pull request as ready for review September 14, 2026 08:49
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.

/model misleadingly reports a switch when the selected model is already active

1 participant