Opus finding
Anthropic streamMessage discards inputTokens/outputTokens on abort instead of returning partial usage
- src/providers/anthropic.ts:116-134
On abort the partial response is returned with inputTokens/outputTokens hardcoded to 0, even though the stream may have emitted tokens. Telemetry/cost accounting will under-report aborted requests. The non-aborted path computes them from finalMessage. At minimum, partial-output length could be used as an estimate, or these fields should be left undefined to signal unknown rather than misreporting zero.
Recommendation
Track running input/output token counts from message_start / message_delta SSE events and return them on abort, or omit usage when unknown.