Release v0.83.0
Merged
LC
13d ago+2594+2594+0123456789012345678901234567890123456789-96-96-01234567890123456789
Release v0.83.0
Bumps version from 0.82.0 to 0.83.0. Promotes dev ā main.
Changelog
Added
LLMCompletionTruncatedErrorandLLMCompletionRefusedError: two subclasses ofLLMCompletionError, the first for a text completion cut at its output limit or its context window, the second for one the model declined to write or a safety filter stopped. Both are content errors in theinputdomain, not retryable, answered with HTTP 422 and caller-facing under STRICT disclosure, and carrymodel_handle,pipe_codeand the provider'sstop_reason, a truncation also carrying the limit it hit astruncation_limit,max_tokensorcontext_window, theoutput_tokensused and themax_tokenssent; the message names the model, the pipe and those values, never the partial text. Each ends with achange_inputnext step fitted to what stopped the text: revise the prompt or the input after a refusal, raise the pipe'smax_tokensor shorten its input at the output limit, set the pipe'smax_tokensup to the model's limit when the request sent none, and shorten the input, lower the reasoning effort or choose a model with a larger window, never a highermax_tokens, at the context window.
Changed
- The Bedrock client's
chatreturns aBedrockChatResult(Breaking):BedrockClientProtocol.chatreturns a named result holding the text, the token usage and Converse'sstopReason, in place of a(text, usage)tuple, so a custom Bedrock client returnsread_converse_response(response=ā¦)or builds the result itself. - A lowered Anthropic structured-output limit is said: when a structured generation on an Anthropic model lowers
max_tokensto fit its structured-output timeout, the call logs it, at warning level when the pipe set the limit and at debug level when it is the model's default, and an error the lowered limit can explain, a structured output that failed validation or came back incomplete, or a timeout, ends with a sentence saying the limit was lowered and to what, never a rate limit, an authentication failure, an overload, a server error or a lost connection.
Fixed
- A truncated, refused or filtered text no longer passes for a result (Breaking): every LLM worker, OpenAI chat completions whether direct or behind a gateway such as Portkey or OpenRouter, the OpenAI Responses API, Anthropic, Google, Bedrock and Mistral, now reads its response's stop value before it returns a text, so a text that stopped short fails its pipe with
LLMCompletionTruncatedErrororLLMCompletionRefusedErrorwhere it used to come back as a successful output, empty or partial, its billed usage still reported and recorded on its span. Each provider's vocabulary is read, including a gateway's pass-through of another provider's value such asmax_tokensorcontent_filtered, an unknown value being logged at warning level and taken as normal, except that anincompleteResponses API answer is a truncation whatever its reason; a Gemini prompt blocked before any candidate is a refusal, and structured generation keeps its configured re-asks. A Bedrock answer is read for every text block it holds, so one holding none fails with anLLMCompletionErrorwhere it used to raise anIndexErrorwhen its message was empty, or aKeyErrorwhen its first block was not text.
š¤ Generated with Claude Code
Summary by cubic
Promotes dev to main as v0.83.0. Every LLM worker now reads its provider's stop signal before returning text, so a completion cut at its output limit or context window, refused by the model, or stopped by a safety filter fails the pipe with LLMCompletionTruncatedError or LLMCompletionRefusedError instead of passing empty or partial text as a successful output. Billed usage is still reported once, and normal stops and configured retries behave as before.
Breaking changes
BedrockClientProtocol.chatnow returns aBedrockChatResultin place of a(text, usage)tuple. Custom Bedrock clients must returnread_converse_response(response=ā¦)or build the result themselves.
Also in this release
- Anthropic logs when it lowers
max_tokensto fit a structured output's timeout ā at warning level when the pipe set the limit, at debug when it is the model's default ā and a failure that lowering can explain names the lowered limit. - Version bumped from
0.82.0to0.83.0; changelog, error docs, and OpenAPI spec updated.