Fix legacy @provider session models#1129
Fix legacy @provider session models#1129franksong2702 wants to merge 1 commit intonesquena:masterfrom
Conversation
|
Thanks for the PR, @franksong2702. The approach looks solid — the three-case decision tree (normalize active-provider hints, preserve still-routable non-active hints, recover stale/unroutable hints) handles the key constraint cleanly: A few notes after reviewing: Logic correctness
Test coverage Minor
Overall looks like a clean, well-scoped fix. Pending maintainer review. |
|
Reviewed — this is clean and the fix is correct. The four-branch logic (active-provider hint → strip, routable non-active → preserve, family match → strip, mismatch → default) is exactly right and the test coverage is solid. Queuing for the next batch release rather than releasing solo — expect it to ship in the next round alongside a couple of other incoming PRs. No changes needed on your end. |
|
Absorbed and shipped in v0.50.224 (PR #1131). Thanks! |
Thinking Path
@provider:modelvalues from the model dropdown, such as@copilot:gpt-5.5.@provider:prefix.What Changed
@provider:modelhandling to_resolve_compatible_session_model().@openai-codex:gpt-5.4-mini->gpt-5.4-mini.Why It Matters
Older sessions can otherwise stay pinned to a provider that is no longer routable. In that state, a session can appear to send but never show an assistant reply until the stored model is manually edited. This keeps old sessions usable without a bulk migration or UI change.
Fixes #1128.
Refs #1023.
Refs #1029.
Verification
python -m py_compile api/routes.pypython -m pytest tests/test_provider_mismatch.py -k "session_model or provider_model or stale_at_provider or legacy_at_provider or active_at_provider or routable_non_active" -vpython -m pytest tests/test_provider_mismatch.py tests/test_model_resolver.py tests/test_credential_pool_providers.py tests/test_issue895_894_nous_prefix.py -vRisks / Follow-ups
Model Used