fix(ai): expose provider response ids on assistant messages fixes #2245

This commit is contained in:
Mario Zechner
2026-03-17 17:11:18 +01:00
parent 18d90b5c48
commit dd53eb56ee
11 changed files with 174 additions and 1 deletions

View File

@@ -264,6 +264,7 @@ export const streamAnthropic: StreamFunction<"anthropic-messages", AnthropicOpti
for await (const event of anthropicStream) {
if (event.type === "message_start") {
output.responseId = event.message.id;
// Capture initial token usage from message_start event
// This ensures we have input token counts even if the stream is aborted early
output.usage.input = event.message.usage.input_tokens || 0;