Skip to content

fix: preserve Gemini refusals and zero-output usage - #17

Merged
ElliotEtag merged 2 commits into
mainfrom
codex/gemini-stream-usage-refusals
Oct 30, 2026
Merged

ElliotEtag merged 2 commits into
mainfrom
codex/gemini-stream-usage-refusals

Conversation

@ElliotEtag

@ElliotEtag ElliotEtag commented Oct 30, 2026 •

Copy link
Copy Markdown

Description:

  • Preserve Google/Vertex prompt blocks, including Google's documented unspecified block, as explicit errors.
  • Preserve zero/omitted output-token usage and reasoning tokens; handle filtered candidates without content parts.
  • Retain reported SSE usage on errors for provider-cost tracking without charging callers.
  • Billing changes: Vertex JSON blocks change from 200/billed to 422/unbilled; SSE blocks change from 502/unbilled to 422/unbilled in Gen tracking. JSON error cost remains untracked by Gen; Google's invoicing for this Gemini model's blocked prompts is unverified.

Tests Run/Test cases added:

  • 27 stream, 47 Vertex and 15 parameter tests; formatting, build and startup checks pass. CI runs parameter and stream tests.
  • Nine Gen/auth/wallet/telemetry E2E cases: five live Google calls (SSE, JSON, tools, zero output, filtered output), four native fixtures (documented block in SSE/JSON, mid-stream failure, missing usage).
  • Successes debit once; errors debit zero. SSE block/mid-stream errors retain provider cost; missing usage stays 502.
  • Local telemetry; JSON uses the inline coordinator helper. Broader tests/typecheck retain main's 8 failing suites and 11 diagnostics.

Type of Change:

  • Bug fix

Rollout: bump Pollinations' 9ffc0ef gateway pin after merge; this also ships #15 (Bedrock errors) and #16 (CI). Reverting the pin rolls back.

@ElliotEtag
ElliotEtag merged commit a1e6a1d into main Oct 30, 2026
4 checks passed
@ElliotEtag ElliotEtag mentioned this pull request Oct 30, 2026
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant