mirror of
https://github.com/langchain-ai/deepagents.git
synced 2026-08-28 05:00:04 -04:00
dfcd9417a8
A transient provider failure after partial output no longer ends the turn: the model call is retried, and already-streamed output is marked as incomplete instead of being joined to the replay. --- Previously, retries stopped once any message chunk had been emitted. This change separates retry policy from presentation: - The middleware emits attempt lifecycle and retry correlation events. - Streaming clients preserve and annotate superseded partial output. - Buffered `--no-stream` mode drops failed-attempt text before writing to stdout. - Transcript, usage, and tool-hook state are scoped by attempt so replayed output is not merged or suppressed. Failed attempts still count toward usage, and clients tolerate missing or malformed lifecycle events for compatibility. Design details and alternatives are documented in `libs/code/STREAMING_RETRY_DESIGN.md`. <details> <summary>Test plan</summary> - Retry behavior before and after output begins - Streaming, buffered, and TUI presentation - Transcript, usage, and tool-hook settlement across retries - Missing, malformed, duplicated, and out-of-order lifecycle events </details> ### Screenshot  Made by [Open SWE](https://openswe.vercel.app/agents/722f8e40-29e4-5eb0-9fd5-368416105bee) --------- Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>