fix(brain): ride out transient Claude 529 overloads
A single Claude 529 Overloaded dropped the voice turn straight to the apology
fallback. The anthropic SDK retries >=500/429 but only twice by default, which
a busy window can outlast. Raise max_retries (WSAI_BRAIN_MAX_RETRIES, default 4)
so transient overloads recover silently, and give overloads their own spoken
fallback ("서버가 붐벼서...") distinct from generic failures. Kept modest so a
sustained outage still fails fast instead of leaving the bot silent.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -304,6 +304,10 @@ class Dashboard:
|
||||
except Exception as exc: # noqa: BLE001
|
||||
log.exception("brain failed")
|
||||
self.monitor.log("error", f"두뇌 응답 실패: {exc}")
|
||||
blob = f"{getattr(exc, 'status_code', '')} {exc}".lower()
|
||||
if "529" in blob or "overload" in blob:
|
||||
# Transient server overload survived the SDK retries.
|
||||
return "지금 서버가 잠깐 붐벼서 생각이 늦네. 잠시 뒤에 다시 말해줄래?"
|
||||
return "미안, 지금 잠깐 생각이 안 났어. 다시 말해줄래?"
|
||||
if not text:
|
||||
return "음, 뭐라고 해야 할지 모르겠어. 다시 말해줄래?"
|
||||
|
||||
Reference in New Issue
Block a user