In this article
Inject a provider error inside an HTTP-success completion and verify rejection, fallback policy and consumed usage; partial text must not become a completed answer.
The November 15 LiteLLM v1.111.0-dev.4 prerelease changes failed non-streaming OpenRouter completions to raise an error. A provider response can carry HTTP success while generation itself failed. Applications that previously consumed a partial answer need a deliberate exception path, and accounting must still recognize work already performed by the failed attempt.
HTTP status is only the outer envelope
A controlled provider fixture can return a plausible partial answer alongside an explicit generation error in an otherwise successful HTTP response. Send it through the non-streaming integration and assert the caller receives failure. Do not accept a nonempty content field as proof of completion. This checks the exact behavior the release changes without depending on a real provider incident or an unpredictable long-generation failure.
A changed exception path can expose caller assumptions
Inspect code that immediately reads the first choice or writes the answer into durable task state. It must now handle an exception for the failed response. Verify no completion flag is committed before validation. If partial output is retained for diagnosis, mark it as rejected evidence rather than a usable answer. This prevents a later resumed agent from treating an interrupted generation as a completed reasoning step.
Fallback must not duplicate completed effects
Configure one permitted fallback with an observable marker and verify when it is attempted. Keep the model call separate from any consequential tool execution. If the larger workflow already performed a tool effect before generation failed, use a stable operation ledger before replaying the workflow. The gateway can expose the model failure correctly while application-level retries still repeat work that happened outside that model request.
Failure still has accounting
Inspect failed-attempt usage and cost separately from a fallback’s successful usage. The implementation preserves consumed work, so a lower successful-request count should not imply zero spend. Reconcile request identities across logs and the caller outcome. The acceptance result is an honest failure contract for incomplete generation, with known retry behavior and accounting, rather than a promise that an error response eliminates the cost of the attempted answer.
Sources
Related reading
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.