fix(account-snapshot): treat timeout/http5xx as transient fallback failures

Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-09-12 13:34:51 +00:00
committed by GitHub
co-authored by genichin
parent 084e05a97d
commit e3142017c9
2 changed files with 15 additions and 4 deletions
+2 -2
View File
@@ -217,7 +217,7 @@ class AccountSnapshotService:
try:
return self._broker.get_balance()
except BrokerBalanceError as exc:
if exc.code != "transport_failed":
if exc.code not in {"transport_failed", "timeout", "http_5xx"}:
raise AccountSnapshotUnavailable(
"live_read_failed", detail_code=exc.code
) from None
@@ -253,7 +253,7 @@ class AccountSnapshotService:
reserved_cash: float = 0.0,
) -> Optional[str]:
"""Return a stable rejection reason, or None when bounded admission passes."""
if self._last_cash_error not in {None, "transport_failed"}:
if self._last_cash_error not in {None, "transport_failed", "timeout", "http_5xx"}:
return "account_snapshot_unavailable"
try:
snapshot = self._load_current()