Q65: every call path records real tokens, cache, reasoning and cost

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-08 11:24:54 -04:00
1 parent 1367a8900e
commit c2f8e656f6
15 files changed
+187 -37

No files matched your search

@@ -170,7 +170,10 @@ export class ProviderBackgroundService {
startedAt,
action: "background_response_completed",
});
this.requestStore.recordUsage(request.org_id, provider.id, request.input_char_count, responseText.length);
this.requestStore.settleUsage({
orgId: request.org_id, requestId: request.id, provider, rawResponseJson: result.rawResponseJson,
inputCharCount: request.input_char_count, outputCharCount: responseText.length,
});
return;
}
if (CANCELLED_BACKGROUND_STATUSES.has(result.status)) {