fix(webui): recover model failures and align chat controls
This commit is contained in:
1 parent
688976bcb9
commit
28f6c26946
42 files changed
+646
-82
No files matched your search
@@ -447,4 +447,9 @@ def recovery_state_from_metadata(metadata: Mapping[str, Any] | None) -> dict[str
|
||||
can_continue = state.get("can_continue")
|
||||
if isinstance(can_continue, bool):
|
||||
payload["can_continue"] = can_continue
|
||||
failure_error_kind = state.get("failure_error_kind")
|
||||
if isinstance(failure_error_kind, str) and failure_error_kind in {
|
||||
"authentication", "billing", "connection", "timeout", "rate_limit", "server", "unknown",
|
||||
}:
|
||||
payload["failure_error_kind"] = failure_error_kind
|
||||
return payload
|
||||
@@ -733,7 +733,11 @@ class WebuiTurnCoordinator:
|
||||
failure_attempts=event.failure_attempts,
|
||||
)
|
||||
if self.recovery is not None:
|
||||
await self.recovery.turn_completed(event.context.session_key)
|
||||
await self.recovery.turn_completed(
|
||||
event.context.session_key,
|
||||
failure_kind=event.failure_kind,
|
||||
failure_error_kind=event.failure_error_kind,
|
||||
)
|
||||
if event.outcome == "completed" and is_webui_session_key(event.context.session_key):
|
||||
turn_id = event.context.metadata.get(WEBUI_TURN_METADATA_KEY)
|
||||
if isinstance(turn_id, str) and turn_id:
|
||||
|
||||
Reference in new issue
Block a user