hermes-agent/gateway
joaomarcos 398634eeda fix(cli,gateway): sync base_url/api_mode on global model switch persist
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>
2026-07-17 15:47:08 -07:00
..
assets
…
builtin_hooks
…
platforms fix(gateway): unify reset boundaries vs recovery — promote accidental ends, honor mode=none, adapter-aware resume guidance 2026-07-17 04:51:39 -07:00
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 fix(auxiliary): scope runtime state to each turn 2026-07-17 09:08:30 -07:00
runtime_footer.py
…
scale_to_zero.py
…
session.py fix: harden transcript append retry — lock, matcher, encapsulation, cap 2026-07-17 18:58:29 +05:30
session_context.py
…
shutdown_forensics.py
…
slash_access.py
…
slash_commands.py fix(cli,gateway): sync base_url/api_mode on global model switch persist 2026-07-17 15:47:08 -07:00
status.py
…
status_phrases.py
…
sticker_cache.py
…
stream_consumer.py
…
stream_dispatch.py
…
stream_events.py
…
whatsapp_identity.py
…