Same bug family as #47828, at the config-persistence layer instead of the in-memory agent layer: - cli.py (#25106): the --global /model handlers (both the typed-name path in _handle_model_switch and the picker path in _apply_model_switch_result) wrote model.default/model.provider to config.yaml but never touched base_url/api_mode at all. A provider switch left the OLD endpoint on disk; the next launch reconnected to the previous provider's host under the new model name. - gateway/slash_commands.py (#25107): both persist-global blocks (the picker-tap callback and the typed /model --global path) guarded the write with two INDEPENDENT ifs — `if result.base_url: ...` and `if target_provider != "custom": clear_model_endpoint_credentials(...)`. For named providers the second if always cleared stale values, masking the bug. For a custom provider with an empty resolved base_url, neither branch fired, so the previous custom endpoint's base_url/api_key/ api_mode survived untouched in config.yaml. Fix: explicit set-if-truthy/clear-if-falsy for base_url and api_mode at all four call sites, matching the already-correct pattern in tui_gateway/server.py:_persist_model_switch (fixed for #48305). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| assets | ||
| builtin_hooks | ||
| platforms | ||
| relay | ||
| __init__.py | ||
| authz_mixin.py | ||
| cgroup_cleanup.py | ||
| channel_directory.py | ||
| code_skew.py | ||
| config.py | ||
| cwd_placeholder.py | ||
| dead_targets.py | ||
| delivery.py | ||
| display_config.py | ||
| drain_control.py | ||
| hooks.py | ||
| kanban_watchers.py | ||
| memory_monitor.py | ||
| message_timestamps.py | ||
| mirror.py | ||
| pairing.py | ||
| platform_registry.py | ||
| profile_routing.py | ||
| readiness.py | ||
| response_filters.py | ||
| restart.py | ||
| restart_loop_guard.py | ||
| rich_sent_store.py | ||
| run.py | ||
| runtime_footer.py | ||
| scale_to_zero.py | ||
| session.py | ||
| session_context.py | ||
| shutdown_forensics.py | ||
| slash_access.py | ||
| slash_commands.py | ||
| status.py | ||
| status_phrases.py | ||
| sticker_cache.py | ||
| stream_consumer.py | ||
| stream_dispatch.py | ||
| stream_events.py | ||
| whatsapp_identity.py | ||