Skip to content

v0.108.1 — usage accounting fix

Choose a tag to compare

@wishborn wishborn released this 07 Jul 04:18

Fixed

  • Cached-token double counting (upstream prism-php#1017): OpenRouter, Vertex, and Gemini reported cacheReadInputTokens while leaving those tokens inside promptTokens, overstating input for cost math. All three now follow the Anthropic/OpenAI/DeepSeek convention (promptTokens = non-cached portion, guarded at zero); Gemini also now accounts for implicit caching, not just explicit cachedContentName caches. Regression tests for each.

Tests

  • Backfilled Mistral structured tool-loop fixture tests (both request-shape paths) and the OpenRouter parameterless-tool streaming payload test (fork issue #3).

Suite: 1874 passing, PHPStan clean.