Repository navigation
Conversation
…cost Offline sweep completions report usage.cost_details.upstream_inference_cost when the response is BYOK, matching the gateway billing rule. A BYOK response without an upstream cost reports an unknown cost.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe BYOK sweep cost change is small and sound: it reads Assumptions: The comparison against the gateway billing rule was verified in Files Reviewed (2 files)
Reviewed by deepseek-flash-latest · Input: 51K · Output: 7K · Cached: 567.2K Review guidance: REVIEW.md from base branch |
The offline sweep reads the billed cost of each completion. For a BYOK response, OpenRouter's
usage.costis only its routing fee, and the provider billsusage.cost_details.upstream_inference_cost. The sweep now reads that upstream cost whenis_byokis true, which matches the gateway's billing rule inprocessUsage.shared.ts. A BYOK response without an upstream cost reports an unknown cost.Verification:
vitest run src/scoreboard/sweep.test.ts(27 passed; the two new BYOK cases fail without the change),tsgo --noEmit, oxlint and oxfmt on the changed files.Production prerequisites: none. The change affects only the local offline sweep command and its scoreboard input.