Skip to content

v0.7.120: Preserve Gemini usage trailers

Choose a tag to compare

@SilenNaihin SilenNaihin released this 26 Sep 07:22
49f5dd1

Gemini usage preservation

  • Preserve Gemini and Vertex usage metadata received after a candidate finish, including cache-read counts.
  • Freeze response content at the declared finish while collecting metadata until EOF or the existing bounded read/deadline allowance.
  • Retain independent partial token counts and reconcile only observed, valid cache subsets with bounded state.
  • Preserve one terminal settlement across timeout, transport failure and cancellation without replaying generation.

Companion native package: exp-gateway-native 0.3.108.

Verified with 776 native tests, 3,031 gateway Python tests (28 skipped), 50 JSON/SSE served accounting cases, and the repository's release/wheel/CI gates. The final policy-only update permits assistant merges after explicit human approval while preserving required checks.

This release does not reconstruct historical provider meters, implement Google explicit cache resources, guarantee implicit cache hits, or change historical charges. Shared SSE framing errors that reject an entire byte batch remain outside this fix.

PR: #1110