fix: keep the postgres backfill from disabling telemetry or locking the table

This commit is contained in:
2026-07-31 10:42:55 -04:00
parent 32d7869043
commit 86fb4d5536
5 changed files with 126 additions and 18 deletions
+5 -2
View File
@@ -178,10 +178,13 @@ def _coerce_cached_tokens(usage: Any) -> int | None:
def _coerce_model_reported(value: Any) -> str | None:
"""取响应体的 model 字段(issue #3);非 str 或空白串一律 None"""
"""取响应体的 model 字段(issue #3);非 str 或空白串一律 None,收口时去空白。
去空白不是洁癖: 下游拿这个串做实验快照的 key,`" m "` 与 `"m"` 会造成假分叉。
"""
if not isinstance(value, str) or not value.strip():
return None
return value
return value.strip()
def _resolve_stream_usage(sink: dict[str, Any], salvaged: bool) -> tuple[int, int, str]: