This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
- Google Drive import:`services/import_service.py` 的日期 `IN (...)` 刪除/驗證查詢已改為 SQLAlchemy bind params,不再把 DataFrame 日期值拼進 SQL 字串。
|
||||
- OpenClaw Bot:中文字型下載、趨勢同期 DB 查詢、匯入格式業績預覽解析等 best-effort 區塊已補 debug/exception/warnings,避免真正錯誤完全無跡可查。
|
||||
- Telegram polling bot:舊 callback 正規化失敗、空 `momo:eig:` event_id 回覆失敗仍保持 fail-safe,但已補 debug log。
|
||||
- `ai_call_logger._write_to_db` 不是死函數:它是 `_async_write()` 的 daemon thread target;decorator token 自動抽取與 stack caller 推斷的 best-effort 失敗也已補 debug log。
|
||||
- `ai_call_logger._write_to_db` 不是死函數:它是 `_async_write()` 的 daemon thread target;`infer_caller_from_stack()` 確認無 caller 後已移除。
|
||||
- `cache_manager.FingerprintCache` 與 dashboard shared cache 清理維持 fail-open / best-effort,但已補 debug log,避免 cache fingerprint 或檔案清理失敗完全沉默。
|
||||
|
||||
## 已驗證為已修或過期
|
||||
|
||||
@@ -24,7 +24,6 @@ services/ai_call_logger.py
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import inspect
|
||||
import logging
|
||||
import os
|
||||
import threading
|
||||
@@ -438,18 +437,3 @@ def _safe_meta_json(meta: Dict[str, Any]) -> str:
|
||||
except Exception as e:
|
||||
logger.warning("[AICallLogger] meta json dump failed: %s", e)
|
||||
return '{}'
|
||||
|
||||
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
# 工具:caller 自動推斷(caller 沒給時用)
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
def infer_caller_from_stack(default: str = 'unknown') -> str:
|
||||
"""從 inspect.stack() 推斷 caller(取上 1 層的 module 名末段)。"""
|
||||
try:
|
||||
frame = inspect.stack()[2]
|
||||
module = inspect.getmodule(frame.frame)
|
||||
if module and module.__name__:
|
||||
return module.__name__.split('.')[-1][:64]
|
||||
except Exception:
|
||||
logger.debug("[AICallLogger] infer caller from stack failed", exc_info=True)
|
||||
return default
|
||||
|
||||
Reference in New Issue
Block a user