feat(webui): unify turn observability

This commit is contained in:
Xubin Ren committed 2026-08-22 20:51:24 +08:00
1 parent dbc1801d3c
commit 48eea29313
44 files changed
+1871 -930

No files matched your search

+5 -2
View File
@@ -509,8 +509,6 @@ class FallbackProvider(LLMProvider):
)
continue
await self._notify_fallback_model(fallback_model)
fallback_kwargs = {
**kwargs,
"model": fallback_model,
@@ -541,6 +539,11 @@ class FallbackProvider(LLMProvider):
fallback_response = await call(fallback_provider, fallback_kwargs)
if fallback_response.finish_reason != "error":
# Do not publish a model switch merely because a fallback was
# attempted. A fallback can fail just like the primary, and
# the WebUI would otherwise show a misleading success signal.
# Publish only after this response is known to be usable.
await self._notify_fallback_model(fallback_model)
logger.info(
"Fallback '{}' succeeded after primary '{}' failed",
fallback_model, primary_model,