hermes-agent/tests/tui_gateway
teknium1 3070de1963 fix(tui_gateway): recover custom provider identity from the session's model name
A session pinned to a named custom provider could silently reroute to the
user's default provider on resume/rebuild. Session rows persist the RESOLVED
provider — bare "custom" for every named providers:/custom_providers: entry —
and when no base_url survived in model_config, the existing heal
(canonical_custom_identity) had only the config.model.provider fallback left.
For users whose global default is a BUILT-IN provider (e.g. nous) that tier
cannot fire, so the bare provider was dropped, resume fell back to the default
provider with the session's custom model name, and the default endpoint 404'd
with "Model '<x>' not found. The requested model does not exist in our
configuration or OpenRouter catalog." Re-selecting via /model fixed it until
the next resume — the reported symptom.

Add a model-name recovery tier between the base_url reverse-lookup and the
config fallback: find_custom_provider_identity_by_model() maps the stored
model back to the entry that serves it (model/default_model/models catalog,
dict and legacy list shapes). The session row always stores the model, so the
entry identity survives even when the row has no base_url AND the global
default points elsewhere.

All five bare-custom heal sites in tui_gateway/server.py now pass the model:
_ensure_session_db_row, _stored_session_runtime_overrides,
_runtime_model_config, _make_agent, and _model_picker_context.
2026-07-24 10:47:32 -07:00
..
__init__.py
test_billing_rpc.py
test_codex_app_server_live_events.py feat(codex): stream live app-server events to TUI/desktop tool cards 2026-07-17 13:44:12 -07:00
test_compaction_status.py fix(desktop): synchronize context usage and compaction status 2026-07-22 16:58:58 -07:00
test_compress_lock_skip.py fix(compress): classify unconfirmed lock-acquire failures and cover all manual-compress surfaces 2026-07-23 08:19:14 -07:00
test_compute_host.py feat(dashboard): isolate turns in compute host (#65895) 2026-07-16 15:24:03 -04:00
test_compute_host_phase1.py fix(desktop): salvage /compress cluster — session.compress RPC + dedicated RPC routing (#68229) 2026-07-22 16:40:06 -04:00
test_custom_provider_session_persistence.py fix(tui_gateway): recover custom provider identity from the session's model name 2026-07-24 10:47:32 -07:00
test_delegation_session_lifecycle.py
test_entry_sys_path.py
test_fast_session_scope.py fix(desktop): session-scope fast mode, surface profile ownership + pinned model override 2026-07-17 14:31:10 -04:00
test_finalize_session_persist.py
test_gateway_owned_session_reap.py
test_goal_command.py
test_image_routing_stale_model.py fix(tui): route images with the live switched model 2026-07-17 09:08:30 -07:00
test_inline_rpc_gil_starvation.py fix(desktop): prevent false runtime-not-ready under gateway load (#66174) 2026-07-20 10:51:27 -04:00
test_interim_assistant_callback.py fix(desktop, ink): don't wipe messages before final message (#65919) 2026-07-20 11:42:29 -04:00
test_iso_certify_seam.py fix(ci): make tests, workflows, and attribution reliable under load (#66373) 2026-07-17 20:55:24 +00:00
test_make_agent_provider.py
test_mcp_late_refresh_thread_owner.py
test_mcp_reload_rev.py fix(tui): revision-aware reload.mcp — an ack now means the revision was LOADED 2026-07-21 20:27:15 -05:00
test_moa_reference_emit.py
test_model_switch_marker_role.py fix(timeline): persist typed display events (#69771) 2026-07-23 14:46:24 -04:00
test_pet_generate_rpc.py
test_project_tree.py
test_projects_rpc.py feat(desktop): configure repository discovery (supersedes #67630) (#68642) 2026-07-21 10:09:31 -04:00
test_protocol.py fix(tui_gateway): tolerate late clarify + terminal.read replies after timeout (#69773) 2026-07-22 23:24:42 -05:00
test_reasoning_config_per_model.py
test_reasoning_session_scope.py
test_render.py
test_review_summary_callback.py
test_session_platform_resolution.py
test_slash_worker_ansi.py
test_slash_worker_mcp_discovery.py
test_slash_worker_profile_home.py
test_slash_worker_sys_path.py
test_subagent_child_mirror.py
test_subprocess_encoding.py fix: address review — add regression test, revert cosmetic churn, cross-link #61595 2026-07-24 09:48:28 -07:00
test_undo_command.py
test_wait_for_mcp_discovery.py fix(ci): make tests, workflows, and attribution reliable under load (#66373) 2026-07-17 20:55:24 +00:00