You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(model): classify empty provider streams as retryable (#183)
Bedrock intermittently terminates ConverseStream responses without ever
starting an assistant message when a model emits an empty completion
(observed in production on Haiku 4.5 as messageStop with no prior
messageStart and zero output tokens). The strict stream state machine
correctly rejects the shape but surfaced it as an opaque protocol error
that retry middleware could not detect.
Introduce model.ErrEmptyStream plus model.NewEmptyStreamError, which pair
the sentinel with a retryable unavailable ProviderError (code
empty_stream). The Bedrock and Anthropic adapters classify message stop
without an active message and event streams that close before message
start through it, and classify streams that close mid-message as
retryable truncated_stream provider errors. Duplicate message stops stay
hard protocol errors. Adapters still never fabricate responses; retry
policy remains with the integrating application.
0 commit comments