A cut-off streaming reply in claude -p is now retried automatically, asking the model to resume.
tengu_truncated_response_recovery Not enough to sayNothing here resolved what this flag was doing on this version, so nothing here should be read as on or off.
This account: no value returned · anonymous baseline: no value returned · compiled default in v2.1.246: off
Read once, for one account on one subscription tier, against v2.1.246. It isn't a statement about your account. What a flag value here can and cannot tell you
What's wrong with this entry?
If a streaming reply dies after the model has already produced output (idle timeout, mid-stream server error, dropped connection, laptop sleep), a claude -p run now re-sends the turn with a note telling the model its response was cut off and to resume from where it stopped, up to a fixed number of attempts. Controlled by tengu_truncated_response_recovery, which defaults to on. Interactive sessions are unchanged and still show the partial reply plus the error line.
- The synthesized API-error message carries a new
truncatedAfterOutputflag, set when output had already been yielded and the stop reason was nottool_use. - The retry only fires for non-interactive sessions on the main thread, not in subagents or sidechains.
- The injected meta user message says "Your response above was cut off mid-stream." and asks the model to continue.
- Each retry is recorded under
query_truncated_response_recoveryasnudgedwith anattemptnumber, orexhaustedonce the cap is hit, after which the error message is yielded as before. - The re-issued turn is tagged
transition: { reason: "truncated_response_recovery" }.
tengu_truncated_response_recovery
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
Related
Other releases about the same thing. Found by shared names or similar wording; neither means one caused the other.
-
v2.1.219
Headless text output recovers the last full assistant message on an incomplete run
Both mention headless mode
-
v2.1.227
Headless mode reports fatal errors instead of dying quietly
Both mention headless mode
-
v2.1.248
Headless loop guards against missing stream event fields
Both mention headless mode