Files
openclaw/packages
Peter Steinberger 74500f334e fix(ai): truncated Anthropic streams error; proxies exempt from message_stop contract (#120030)
* fix(ai): enforce message_stop only for direct Anthropic models

The Anthropic SSE transport threw 'stream ended before message_stop' only when
a refusal buffer happened to be non-empty, so a truncated first-party stream
could pass silently while compatible proxy providers that legitimately omit
message_stop failed intermittently. The invariant now keys off the transport
contract owner: direct Anthropic models always require message_stop; proxy
providers are exempt.

* test(ai): cover proxy streams ending without message_stop

ClawSweeper P1: the proxy exemption had no focused test, so the lenient
branch could regress silently. A non-anthropic provider through a custom
endpoint now proves stopReason=stop with no error when the stream ends
without message_stop.
2026-08-07 01:49:46 -07:00
..