feat: Update response handling and logging for improved usage tracking

This commit is contained in:
decolua committed 2026-02-03 10:22:43 +07:00
1 parent a33924b336
commit df0e1d6485
7 files changed
+348 -152

No files matched your search

@@ -192,7 +192,10 @@ export function openaiToClaudeResponse(chunk, state) {
});
}
// Use tracked usage or default to 0
// Mark finish for later usage injection in stream.js
state.finishReason = choice.finish_reason;
// Use tracked usage (will be estimated in stream.js if not valid)
const finalUsage = state.usage || { input_tokens: 0, output_tokens: 0 };
results.push({
type: "message_delta",