Results / truncation.text-stream-usage

Streamed text cut off before a final usage chunk

The model stops a streamed answer at the token limit and reports usage in a separate final chunk.

Bug class: Truncation not reported as truncation

The provider stopped at the output token limit, but the library reports a normal finish, a generic parse error, or a partial result as success.

Agents accept partial output or retry without raising the limit, and structured pipelines ingest incomplete records.

Requirements

LevelIdCheckRequirementProviders
MUSTcause-is-truncationtruncation_is_signalledThe caller can tell that the output stopped at the token limit.All
SHOULDtext-reportedtext_matches_truthThe text is reported exactly as the provider sent it.All
SHOULDusage-reportedusage_matches_truthToken usage is reported and matches the provider's counts.All

Fixtures

ProviderTierany-llmlitellmpydantic-aitanstack-aivercel-ai
geminirecorded✓ PASS✓ PASS✓ PASS✓ PASS✓ PASS
openai-chatrecorded✓ PASS✓ PASS✓ PASS✓ PASS✓ PASS