feat(usage): add unified provider usage backend

This commit is contained in:
chengyongru authored and chengyongru committed 2026-08-25 01:22:25 +08:00
1 parent 8bb3828487
commit 2ac802b2d5
24 files changed
+1605 -808

No files matched your search

-7
View File
@@ -479,13 +479,6 @@ async def cmd_dream(ctx: CommandContext) -> OutboundMessage:
elapsed = time.monotonic() - t0
content = f"Dream failed after {elapsed:.1f}s: {e}"
finally:
from nanobot.webui.token_usage import record_response_token_usage
record_response_token_usage(
resp,
source="dream",
timezone_name=getattr(loop.context, "timezone", None),
)
if store.git.is_initialized():
commit_msg = build_dream_commit_message("dream: manual run", diff_body)
sha = store.git.auto_commit(commit_msg)