{"version":"2.1.246","anchor":"non-interactive-runs-retry-a-response-that-was-cut-off-mid-s","canonical_anchor":"non-interactive-runs-retry-a-response-that-was-cut-off-mid-s","heading":"Non-interactive runs retry a response that was cut off mid-stream","tier":"notice","area":"Headless Mode","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.246\/e\/non-interactive-runs-retry-a-response-that-was-cut-off-mid-s","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.246","markdown":"### Non-interactive runs retry a response that was cut off mid-stream\n\nA cut-off streaming reply in claude -p is now retried automatically, asking the model to resume.\n\n**What**\n\nIf 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.\n\n**Details**\n\n- The synthesized API-error message carries a new `truncatedAfterOutput` flag, set when output had already been yielded and the stop reason was not `tool_use`.\n- The retry only fires for non-interactive sessions on the main thread, not in subagents or sidechains.\n- The injected meta user message says \"Your response above was cut off mid-stream.\" and asks the model to continue.\n- Each retry is recorded under `query_truncated_response_recovery` as `nudged` with an `attempt` number, or `exhausted` once the cap is hit, after which the error message is yielded as before.\n- The re-issued turn is tagged `transition: { reason: \"truncated_response_recovery\" }`.\n\n**Evidence**\n\n`tengu_truncated_response_recovery`\n\n- Flag `tengu_truncated_response_recovery`: Not enough to say (read for one account on one subscription tier against v2.1.246; this account: no value returned, anonymous baseline: no value returned, compiled default: on)\n- Area: Headless Mode\n- Names: `claude -p`\n- Tier: You'll notice\n- Useful: 4\/5\n- Signal: 3\/5"}