Skip to content

fix(chat): Retry transient provider stream failures#413

Merged
dcramer merged 1 commit into
mainfrom
dcramer/fix/provider-stream-retry
May 24, 2026
Merged

fix(chat): Retry transient provider stream failures#413
dcramer merged 1 commit into
mainfrom
dcramer/fix/provider-stream-retry

Conversation

@dcramer
Copy link
Copy Markdown
Member

@dcramer dcramer commented May 24, 2026

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=error now 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

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment May 24, 2026 4:05pm

Request Review

@dcramer dcramer marked this pull request as ready for review May 24, 2026 17:36
@dcramer dcramer merged commit 1bab899 into main May 24, 2026
16 checks passed
@dcramer dcramer deleted the dcramer/fix/provider-stream-retry branch May 24, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant