fix(health): preserve transient failure codes through stale snapshot fallback

Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-09-12 13:37:45 +00:00
committed by GitHub
co-authored by genichin
parent 4a2e7dd893
commit 9c5a01ed67
3 changed files with 25 additions and 4 deletions
+5 -3
View File
@@ -443,9 +443,11 @@ class ExecutionService:
try:
holdings = self._sell_dispatch_balance_reader()
except AccountSnapshotUnavailable as exc:
code = "stale_snapshot" if exc.code == "expired" else (
getattr(exc, "detail_code", None) or exc.code
)
detail_code = getattr(exc, "detail_code", None)
if exc.code == "expired" and detail_code is None:
code = "stale_snapshot"
else:
code = detail_code or exc.code
lifecycle, backoff = self._balance_health.record_failure(
self._balance_worker, code=code
)