Skip to content

Self-hosted AI workspace.

Python

fix: guard uid.decode() in auto-classify warning log against str UIDs (#1472)

Paulo Victor Cordeiroac09fb3c5765
diff --git a/routes/email_pollers.py b/routes/email_pollers.py
index 78f74abf9..fad6b0920 100644
--- a/routes/email_pollers.py
+++ b/routes/email_pollers.py
@@ -829,7 +829,7 @@ async def _auto_summarize_pass_single(days_back: int = 1, account_id: str | None
_req.post, url, json=payload, headers=req_headers, timeout=120
)
if not resp.ok:
- logger.warning(f"Auto-classify {uid.decode()} HTTP {resp.status_code}: {resp.text[:200]}")
+ logger.warning(f"Auto-classify {uid.decode() if isinstance(uid, bytes) else str(uid)} HTTP {resp.status_code}: {resp.text[:200]}")
else:
rdata = resp.json()
m = (rdata.get("choices") or [{}])[0].get("message", {})