mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
* fix: add cache reporting support for OpenAI-Native provider - Add normalizeUsage method to properly extract cache tokens from Responses API - Support both detailed token shapes (input_tokens_details) and legacy fields - Calculate cache read/write tokens with proper fallbacks - Include reasoning tokens when available in output_tokens_details - Ensure accurate cost calculation using uncached input tokens This fixes the issue where caching information was not being reported when using the OpenAI-Native provider with the Responses API. * fix: improve cache token normalization and add comprehensive tests - Add fallback to derive total input tokens from details when totals are missing - Remove unused convertToOpenAiMessages import - Add comment explaining cost calculation alignment with Gemini provider - Add comprehensive test coverage for normalizeUsage method covering: - Detailed token shapes with cached/miss tokens - Legacy field names and SSE-only events - Edge cases including missing totals with details-only - Cost calculation with uncached input tokens * fix: address PR review comments - Remove incorrect fallback to missFromDetails for cache write tokens - Fix cost calculation to pass total input tokens (calculateApiCostOpenAI handles subtraction) - Improve readability by extracting cache detail checks to intermediate variables - Remove redundant ?? undefined - Update tests to reflect correct behavior (miss tokens are not cache writes) - Add clarifying comments about cache miss vs cache write tokens |
||
|---|---|---|
| .. | ||
| anthropic-vertex.spec.ts | ||
| anthropic.spec.ts | ||
| bedrock-custom-arn.spec.ts | ||
| bedrock-error-handling.spec.ts | ||
| bedrock-inference-profiles.spec.ts | ||
| bedrock-invokedModelId.spec.ts | ||
| bedrock-reasoning.spec.ts | ||
| bedrock-vpc-endpoint.spec.ts | ||
| bedrock.spec.ts | ||
| cerebras.spec.ts | ||
| chutes.spec.ts | ||
| claude-code-caching.spec.ts | ||
| claude-code.spec.ts | ||
| constants.spec.ts | ||
| deepseek.spec.ts | ||
| featherless.spec.ts | ||
| fireworks.spec.ts | ||
| gemini-handler.spec.ts | ||
| gemini.spec.ts | ||
| glama.spec.ts | ||
| groq.spec.ts | ||
| io-intelligence.spec.ts | ||
| lite-llm.spec.ts | ||
| lm-studio-timeout.spec.ts | ||
| lmstudio.spec.ts | ||
| mistral.spec.ts | ||
| moonshot.spec.ts | ||
| native-ollama.spec.ts | ||
| ollama-timeout.spec.ts | ||
| ollama.spec.ts | ||
| openai-native-usage.spec.ts | ||
| openai-native.spec.ts | ||
| openai-timeout.spec.ts | ||
| openai-usage-tracking.spec.ts | ||
| openai.spec.ts | ||
| openrouter.spec.ts | ||
| requesty.spec.ts | ||
| roo.spec.ts | ||
| sambanova.spec.ts | ||
| unbound.spec.ts | ||
| vercel-ai-gateway.spec.ts | ||
| vertex.spec.ts | ||
| vscode-lm.spec.ts | ||
| xai.spec.ts | ||
| zai.spec.ts | ||