Skip to content

Fix split provider usage stream frames#116

Merged
pablopunk merged 2 commits into
mainfrom
pablopunk/buffer-provider-stream-frames
Jul 15, 2026
Merged

Fix split provider usage stream frames#116
pablopunk merged 2 commits into
mainfrom
pablopunk/buffer-provider-stream-frames

Conversation

@pablopunk

@pablopunk pablopunk commented Jul 15, 2026

Copy link
Copy Markdown
Owner

This PR fixes stream usage tracking for proxy responses to ensure that token usage is correctly captured even when the provider's streaming data is fragmented across multiple chunks. It prevents cases where usage could be missed due to line breaks or chunk boundaries occurring in the middle of a frame, including splits inside multibyte characters or when the final frame lacks a trailing newline. The improvement applies consistently across OpenAI, Anthropic, and Google streaming providers, making usage billing more reliable.

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nvm Ready Ready Preview, Comment Jul 15, 2026 3:28pm

@kody-ai

kody-ai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@pablopunk
pablopunk merged commit 1425095 into main Jul 15, 2026
9 checks passed
@pablopunk
pablopunk deleted the pablopunk/buffer-provider-stream-frames branch July 15, 2026 15:32
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