fix(chat): Retry transient provider stream failures#413
Merged
Conversation
Retry transient provider stream errors from the last safe Pi boundary instead of surfacing an immediate failed turn. This trims the failed assistant tail, continues from the prior user/tool result boundary, and keeps token usage/checkpoint state accurate across retries. Document the in-process provider retry contract and cover the stream interruption shape that produced JUNIOR-2D. Fixes JUNIOR-2D Co-Authored-By: GPT-5 Codex <codex@openai.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retry transient provider stream errors from the last safe Pi boundary instead of immediately finalizing the turn as failed. This trims only the failed assistant tail, verifies the remaining history can continue, persists the safe boundary, and calls
continue()so prior tool results are reused rather than replayed.Provider Retry
Transient provider errors such as interrupted Anthropic streams now retry in-process with bounded backoff before final Slack delivery. Retry attempts preserve cumulative usage so diagnostics and reply footers account for failed provider calls.
Failure Classification
Empty terminal assistant messages with
stopReason=errornow classify as provider errors instead of execution failures, avoiding misleading empty-response diagnostics when the provider stream itself failed.Resumability Contract
The session resumability spec now documents the in-process provider retry contract and its safety boundaries.
Fixes JUNIOR-2D