Repository navigation
v0.4.10
miao v0.4.10
v0.4.10 keeps an Anthropic turn alive when the endpoint closes it legally but unusually: a reply that ran out of output room, a turn the endpoint paused, a thinking signature the rewritten history can no longer satisfy, and a parameterless tool call that was read as garbled JSON. It also stops capping Anthropic output at 4096 tokens.
A truncated or paused reply continues the turn
The Anthropic codec accepted only tool_use, end_turn and stop_sequence, while the Bedrock codec also accepted max_tokens. A reply that hit the output cap is not a malformed stream: the visible content is valid and any streamed call is incomplete. miao reported invalid provider stream: incomplete or unsupported stop reason and ended the turn with no answer.
max_tokens and pause_turn now continue the turn the way a truncated Chat reply already did: reasoning and text are committed, an unfinished call never executes, and the turn continues from durable history with only the remaining work. refusal reaches the operator as the text it carried, and an unknown stop reason now names the value it saw instead of hiding it behind "unsupported".
A stale thinking signature no longer dead-ends a Session
Anthropic binds a signed thinking block to the exact conversation prefix it was minted on. Any rewrite of an earlier message — tool-output pruning, the last-resort bound, an injected note, a switched model, or a retry that re-assembled the history — voids every signature behind the changed message, and no later request can satisfy the endpoint again:
messages.19.content.0: Invalid `signature` in `thinking` block.
The block is bound to a different conversation.
The endpoint's own remedy is "remove the block", so miao now replays that turn once with reasoning stripped from the outgoing history, announces the recovery as a provider retry, and no longer spends the generic identical 400 replay on a rejection a replay can never fix. The durable transcript keeps its reasoning; only the wire copy drops it.
"No arguments" is an answer
A model calls a parameterless tool with no arguments, and the empty argument string was read as garbled JSON. Three of those in one run paused the Session with "Stopped after the model repeatedly produced invalid JSON tool arguments" — a correct call shape treated as a defect.
Empty arguments now decode as the empty input. Whether that input is usable is the tool schema's question, answered by the tool itself. A call still never borrows another function's arguments from surrounding text.
The declared output cap is honoured
Anthropic requires an explicit max_tokens, and miao always sent 4096 because the setter had no production caller. Extended thinking is billed inside that budget, so a long thinking turn could spend the whole cap on reasoning and hand back a truncated reply. Model routes that declare a per-model limit.output now forward it to the Anthropic codec; providers that ignore the cap keep their own default.