co-mono/packages/ai/test
Mario Zechner bc8d994a7b Fix token statistics on abort for Anthropic provider
- Add handling for message_start event to capture initial token usage
- Fix message_delta to use assignment (=) instead of addition (+=)
  since Anthropic sends cumulative token counts, not incremental
- Add comprehensive tests for all providers (Google, OpenAI Completions,
  OpenAI Responses, Anthropic)
- Document OpenAI limitation: token stats only available at stream end

Fixes issue where aborted streams had zero token counts despite
Anthropic sending input tokens in the initial message_start event.
2025-10-26 21:22:24 +01:00
..
data feat(ai): Add image input tests for vision-capable models 2025-08-30 18:37:17 +02:00
abort.test.ts Add timestamp to messages 2025-10-26 00:43:43 +02:00
agent.test.ts Add timestamp to messages 2025-10-26 00:43:43 +02:00
empty.test.ts Add timestamp to messages 2025-10-26 00:43:43 +02:00
enum-test.ts refactor(ai): improve error handling and stop reason types 2025-09-18 19:57:13 +02:00
handoff.test.ts Add timestamp to messages 2025-10-26 00:43:43 +02:00
stream.test.ts Add timestamp to messages 2025-10-26 00:43:43 +02:00
tokens.test.ts Fix token statistics on abort for Anthropic provider 2025-10-26 21:22:24 +01:00
tool-call-without-result.test.ts Add timestamp to messages 2025-10-26 00:43:43 +02:00
tool-validation.test.ts Fix NodeJS compat 2025-09-16 02:19:47 +02:00
unicode-surrogate.test.ts Add timestamp to messages 2025-10-26 00:43:43 +02:00