Move session logs to private

This commit is contained in:
Owen
2026-08-19 17:25:32 -04:00
parent 887e13888d
commit c1caa30cb9
13 changed files with 544 additions and 383 deletions
+4 -2
View File
@@ -86,7 +86,7 @@ import {
type AiUsage
} from "@server/lib/aiUsageExtraction";
import { streamAiGatewayResponse } from "@server/routers/aiGateway/streamAiGatewayResponse";
import { logAiSession } from "@server/routers/aiGateway/logAiSession";
import { logAiSession } from "#dynamic/routers/aiGateway/logAiSession";
const EXIT_NODE_RANGES_CACHE_KEY = "aiGateway:exitNodeRanges";
const EXIT_NODE_RANGES_TTL_SEC = 6000;
@@ -728,7 +728,9 @@ export function recordAiGatewayCompletion(args: {
let cost: ReturnType<typeof calculateAiCost> = null;
if (upstreamSucceeded) {
usage = extractUsage(capability, responseText, isStream, headers) ?? emptyUsage();
usage =
extractUsage(capability, responseText, isStream, headers) ??
emptyUsage();
if (isUsageEmpty(usage)) {
usage = estimateUsage(
JSON.stringify(requestBody ?? ""),