fix(xiaomi): preserve Token Plan base URLs during auth recovery - #46700
fix(xiaomi): preserve Token Plan base URLs during auth recovery#46700teknium1 wants to merge 1 commit into
Conversation
Salvages Xiaomi MiMo base-url routing fixes from #44099/#33648/#42699 while keeping base-url configuration in config.yaml rather than expanding env-var guidance. Co-authored-by: AIalliAI <285906080+AIalliAI@users.noreply.github.com> Co-authored-by: Jim Dawdy <262052366+jimdawdy-hub@users.noreply.github.com> Co-authored-by: mlaihk <25972362+mlaihk@users.noreply.github.com>
🔎 Lint report:
|
Code Review: Token Plan base URL preservation across credential rotationThe core fix —
This is conservative and correct. The The No issues found. |
|
Closing this salvage PR as wrong-premise for this batch. It addresses a different Xiaomi Token Plan/base-url preservation problem, not the reported Nous endpoint failure for Parts of this may be valid for the separate #44070-style base-url bug, but it needs its own focused review and reproduction, not inclusion in this MiMo/NouS provider-error cluster. Thanks to the original contributors whose fixes were credited here; this consolidation was our mistake. |
Summary
Preserves configured Xiaomi MiMo Token Plan base URLs through auth add, credential rotation, and model switches. A valid Token Plan key should not get re-pinned from
model.base_urlback to the standard registry endpoint after pool recovery.Changes
run_agent.py: keep the current configured base URL when a rotated pool entry only carries the provider registry default.agent/agent_runtime_helpers.py: detach stale credential pools when/modelswitches to another provider.hermes_cli/auth_commands.py: persist the active provider'smodel.base_urlinto manually added pool credentials.plugins/model-providers/xiaomi: add current MiMo V2.5 fallback models without adding new user-facing env-var guidance.Salvaged from
XIAOMI_BASE_URLenv expansion/guidance because non-secret endpoint configuration belongs inconfig.yaml.Validation
scripts/run_tests.sh tests/run_agent/test_44070_credential_swap_base_url.py tests/hermes_cli/test_auth_commands.py tests/hermes_cli/test_xiaomi_provider.py tests/hermes_cli/test_model_switch_opencode_anthropic.pypython3 -m py_compile run_agent.py agent/agent_runtime_helpers.py hermes_cli/auth_commands.py plugins/model-providers/xiaomi/__init__.py tests/run_agent/test_44070_credential_swap_base_url.py tests/hermes_cli/test_auth_commands.py tests/hermes_cli/test_xiaomi_provider.py scripts/release.pygit diff --checkInfographic