補強 AI logger best-effort 診斷
Some checks failed
CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
OoO
2026-05-13 11:02:38 +08:00
parent ec5a22dd24
commit f44c429a56
2 changed files with 4 additions and 2 deletions

View File

@@ -20,6 +20,7 @@
- Observability routepromotion review RAG 相似查詢、PPT audit history 缺表、host health probe 寫入、MCP 24h summary 缺表等 fail-safe 區塊已改成 debug/warning log不再完全靜默。
- Google Drive import`services/import_service.py` 的日期 `IN (...)` 刪除/驗證查詢已改為 SQLAlchemy bind params不再把 DataFrame 日期值拼進 SQL 字串。
- OpenClaw Bot中文字型下載、趨勢同期 DB 查詢、匯入格式業績預覽解析等 best-effort 區塊已補 debug/exception/warnings避免真正錯誤完全無跡可查。
- `ai_call_logger._write_to_db` 不是死函數:它是 `_async_write()` 的 daemon thread targetdecorator token 自動抽取與 stack caller 推斷的 best-effort 失敗也已補 debug log。
## 已驗證為已修或過期
@@ -79,3 +80,4 @@
- `f9d3da5` 記錄 AutoHeal DB guardrail 驗證
- `7e92850` 記錄 Agent Actions 動態入口驗證
- `89c400d` 補上 OpenClaw best-effort 區塊紀錄
- `ec5a22d` 記錄 Telegram pending action 驗證

View File

@@ -290,7 +290,7 @@ def logged_ai_call(
try:
_auto_extract_tokens(ctx, result)
except Exception:
pass
logger.debug("[AICallLogger] auto token extraction failed", exc_info=True)
return result
return wrapper
return deco
@@ -451,5 +451,5 @@ def infer_caller_from_stack(default: str = 'unknown') -> str:
if module and module.__name__:
return module.__name__.split('.')[-1][:64]
except Exception:
pass
logger.debug("[AICallLogger] infer caller from stack failed", exc_info=True)
return default