continue-custom/packages
continue[bot] bbeec4b1bf fix(openai-adapters): Add fallback to stream.usage Promise for usage tokens
Vercel AI SDK's fullStream may emit a finish event with zero/invalid usage
data in real API calls, even though tests show it working. This implements
a hybrid approach:

1. convertVercelStream emits usage from finish event if valid (>0 tokens)
2. Track whether usage was emitted during stream consumption
3. If no usage emitted, fall back to awaiting stream.usage Promise

This ensures tests pass (which have valid finish events) while also
handling real API scenarios where finish events may have incomplete data.

Changes:
- vercelStreamConverter: Only emit usage if tokens > 0
- OpenAI.ts: Add hasEmittedUsage tracking + fallback
- Anthropic.ts: Same approach with cache token support

Co-authored-by: nate <nate@continue.dev>
Generated with [Continue](https://continue.dev)
2025-12-10 19:44:41 +00:00
..
config-types fix: upgrade zod from 3.24.2 to 3.25.76 2025-11-04 07:18:35 +00:00
config-yaml merge main 2025-12-02 12:25:02 -08:00
continue-sdk fix: packages/continue-sdk/python/api/requirements.txt to reduce vulnerabilities 2025-12-08 08:04:54 +00:00
fetch feat: simplify onboarding 2025-12-03 16:21:28 -08:00
hub chore: config yaml 36, fetch 6 (#8906) 2025-12-01 11:27:26 -08:00
llm-info merge main 2025-12-02 12:25:02 -08:00
openai-adapters fix(openai-adapters): Add fallback to stream.usage Promise for usage tokens 2025-12-10 19:44:41 +00:00
terminal-security style: run prettier on terminal security code 2025-10-30 00:56:55 +00:00
shared-release.config.js fix prettier 2025-07-18 19:20:13 +02:00