fix(webui): identify OAuth reauthentication behind fallback replies
This commit is contained in:
1 parent
a05f11ba10
commit
448767d147
28 files changed
+269
-40
No files matched your search
@@ -38,7 +38,7 @@ from nanobot.bus.runtime_events import (
|
||||
)
|
||||
from nanobot.llm_usage.context import llm_usage_source
|
||||
from nanobot.providers.base import LLMProvider, LLMUsage
|
||||
from nanobot.providers.fallback_provider import FallbackModelObserver
|
||||
from nanobot.providers.fallback_provider import FallbackModelObserver, FallbackModelSelection
|
||||
from nanobot.runtime_context import public_history_message
|
||||
from nanobot.session.goal_state import goal_state_ws_blob
|
||||
from nanobot.session.history_visibility import is_hidden_history_message
|
||||
@@ -523,7 +523,7 @@ class WebuiTurnRoutePolicy:
|
||||
def build_webui_fallback_model_observer(bus: MessageBus) -> FallbackModelObserver:
|
||||
"""Translate provider fallback choices into chat-scoped WebUI events."""
|
||||
|
||||
async def _publish(model: str) -> None:
|
||||
async def _publish(selection: FallbackModelSelection) -> None:
|
||||
context = current_request_context()
|
||||
if context is None or context.channel != "websocket":
|
||||
return
|
||||
@@ -535,13 +535,14 @@ def build_webui_fallback_model_observer(bus: MessageBus) -> FallbackModelObserve
|
||||
channel=context.channel,
|
||||
chat_id=chat_id,
|
||||
event=TurnModelUpdatedEvent(
|
||||
model=model,
|
||||
model=selection.model,
|
||||
model_preset=(
|
||||
context.runtime.model_preset
|
||||
if context.runtime is not None
|
||||
else None
|
||||
),
|
||||
fallback=True,
|
||||
reauth_provider=selection.reauth_provider,
|
||||
),
|
||||
metadata=context.metadata,
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user