Skip to content

fix(llm): token usage mismatch during early stream aborts on Azure OpenAI models #100954

Description

@aniruddhaadak80

fix(llm): token usage mismatch during early stream aborts on Azure OpenAI models
When an Azure OpenAI stream is aborted extremely early (e.g., due to user cancellation or first-byte timeout), the usage parser occasionally assumes 0 tokens instead of aggregating the partial cache-hit tokens that were successfully transmitted in the very first delta, causing drift in telemetry metrics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions