feat(webui): show runtime model and fallback indicator in sidebar badge - #54895
feat(webui): show runtime model and fallback indicator in sidebar badge#54895lincoln-mackay wants to merge 3 commits into
Conversation
When the fallback chain activates, the model badge now updates to show the runtime model and displays an amber 'Fallback' chip. Hovering reveals which primary model was replaced. Changes: - tui_gateway/server.py: expose fallback_activated, primary_model, primary_provider in session.info WS payload - agent/chat_completion_helpers.py: store _primary_model/_primary_provider before fallback swap (preserves original for chained fallbacks) - agent/agent_runtime_helpers.py: clear fallback state on turn reset and runtime restore (two locations) - agent/agent_init.py: wire fallback state through agent init - web/src/components/ChatSidebar.tsx: use runtime model from session.info when fallback is active, render amber Fallback chip with tooltip Closes NousResearch#54509
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: LGTM — clean fallback indicator feature with good test coverage.
Notes
- Debug print statement on line 14 of agent_init.py (
print(f"[INIT_TRACE] entry: ...")) should be removed before merge - Debug logger.warning statements on lines 217-218, 226 of gateway/run.py (
DBG_RESOLVED,DBG_AGENT_CREATE) should be removed before merge - Debug logger.warning in run_agent.py line 267 (
DBG_DB_CREATE) should be removed before merge
These debug artifacts are non-blocking but should be cleaned up before merge.
Reviewed by Hermes Agent
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: LGTM
Clean, well-scoped change with no concerns.
--- Reviewed by Hermes Agent
|
Gentle ping — this has two LGTM reviews and is mergeable. Anything else needed before it can be merged? |
|
@tonydwb @nesquena-hermes Gentle ping – PR #54895 (runtime model/fallback indicator badge) has two LGTM reviews and is marked MERGEABLE. Anything else needed before it can be merged? Thanks! |
|
Thanks for addressing a real dashboard visibility gap. The current-main premise is confirmed: Problems
Suggested changes
Automated hermes-sweeper review. |
Implementation Status Update - teknium1 Review Response✅ Addressed ConcernInit-time fallback capture - Added
|
- chat_completion_helpers.py: add provider-level retry for silent failures - module-level constants: HERMES_PROVIDER_RETRY_* (max_attempts=3, base_delay=1s, max_delay=30s, backoff=2.0, jitter=0.2) - _is_silent_provider_failure() detects empty responses (no content, tool_calls, reasoning) - _provider_retry_backoff() exponential backoff with ±20% jitter - interruptible_api_call() wrapped in while True with per-attempt state isolation - silent failure check BEFORE error raise with interrupt-safe 100ms backoff wait - continues retry on silent failure, returns on success, raises on exhausted retries - agent_init.py: snapshot primary model/provider before first fallback swap enables UI to show 'Fallback: X (primary: Y)' Follows PR NousResearch#6239 architecture: provider-call level retry (not whole-turn), emission guard, cancellation-safe, no double-emit, NousResearch#4729 flush preserved. All 38 streaming tests pass including new silent retry tests.
|
THIS FIX HAS BEEN MERGED INTO PR #6239 Thanks all for your contributions to this fix. To streamline and remove duplication, I consolidated the fixes from PRs: All functionality is now available in single, unified PR #6239 which provides: Hopefully the consolidated fix eliminates overhead while preserving all of the fixes & updates |
Bug
When the fallback chain activates (primary model fails → secondary model takes over), the WebUI model badge in the sidebar continues to show the configured primary model name. No visual indication that a fallback model is currently generating.
Closes #54509.
Root Cause
Two-part bug:
_session_info()intui_gateway/server.pysends runtimemodel/providerbut no flag indicating whether those values are from a fallback activationChatSidebar.tsx:306prefers the config-API value over the runtime gateway value:effectiveModel(from/api/model/info→config.yaml) is always populated, the runtime model fromsession.infois never reached.Fix
Backend (Python)
tui_gateway/server.py— Exposefallback_activated,primary_model,primary_providerinsession.infoWS payloadagent/chat_completion_helpers.py— Store_primary_model/_primary_provideron the agent before fallback swap (preserves original for chained fallbacks)agent/agent_runtime_helpers.py— Clear_primary_model/_primary_provider/_fallback_activatedon turn reset and runtime restoreagent/agent_init.py— Wire fallback state through agent initFrontend (TypeScript/React)
web/src/components/ChatSidebar.tsx—fallback_activated,primary_model,primary_providertoSessionInfointerfaceinfo.modelover configeffectiveModelwhen fallback is activeBehavior
Verification
tsc -p . --noEmit→ exit 0vite build→ built successfully (1.16s)