Repository navigation
fix(think): route transient and rate_limit stream errors into bounded recovery (#2085) - #2343
Merged
threepointone merged 6 commits intoSep 24, 2026
Conversation
threepointone
added this pull request to stack #2345
September 23, 2026 19:59
🦋 Changeset detectedLatest commit: 3b25fc2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
threepointone
marked this pull request as ready for review
September 23, 2026 20:33
threepointone
force-pushed
the
fix/2085-transient-stream-recovery
branch
from
September 23, 2026 21:07
b5813e7 to
c25dbed
Compare
Contributor
🟡 agents import sizesMeasured 344 runtime imports as minified bundles. The primary size is gzip; raw minified size is included for diagnosis. An existing import growing by more than 10% is marked red. This report is informational.
Compared Changed imports (1)
All 344 current runtime imports
Reported by agent-think[bot]. |
threepointone
force-pushed
the
fix/2085-transient-stream-recovery
branch
from
September 23, 2026 21:39
c25dbed to
c0cc811
Compare
threepointone
force-pushed
the
fix/2085-transient-stream-recovery
branch
from
September 23, 2026 22:09
c0cc811 to
1d3f2eb
Compare
threepointone
force-pushed
the
fix/2085-transient-stream-recovery
branch
from
September 23, 2026 22:47
1d3f2eb to
c0c0a0c
Compare
threepointone
force-pushed
the
fix/2085-transient-stream-recovery
branch
from
September 23, 2026 23:20
c0c0a0c to
c6a28b6
Compare
… recovery (#2085) Co-authored-by: Cursor <cursoragent@cursor.com>
…ot pin Co-authored-by: Cursor <cursoragent@cursor.com>
… the next attempt Co-authored-by: Cursor <cursoragent@cursor.com>
…mpotency key Co-authored-by: Cursor <cursoragent@cursor.com>
…overy Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
threepointone
force-pushed
the
fix/2085-transient-stream-recovery
branch
from
September 23, 2026 23:58
c6a28b6 to
3b25fc2
Compare
Merged
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.
Fixes #2085.
Stream errors that
classifyChatErrorreturns"transient"or"rate_limit"for now route into bounded chat recovery, the same path as a stream stall (onChatRecovery,chatRecovery.maxAttempts, then the configured exhaustion message). Previously these categories were documented as reserved and the turn ended with the raw error.ChatRecoveryEngine.scheduleRecoverytakes an optionaldelaySeconds.classifyChatErroroverride nothing changes;fatal,unknownandvoidstay terminal.Backoff counter. The delay comes from a durable
transientRetriescount on the incident, not fromattempt.attemptis debounced within 30 seconds and resets on progress, so a provider that fails every retry quickly would otherwise be retried every second forever. Transient retries back off 1, 2, 4, 8, 16, then 30 seconds, and the incident seals oncetransientRetriesreachesmaxAttempts.Repeated failures. When a recovery attempt fails transiently again and schedules the next attempt, the detached retry and continue callbacks no longer mark the incident
failedor finish the durable submission asaborted. They leave both to the scheduled attempt, so the backoff budget is actually used instead of the recovery ending after one retry. The next attempt is enqueued with a new"chained_retry"value ofChatRecoveryScheduleReason, which carries no idempotency key, so it can never join the attempt that scheduled it.Durable submissions. When a submission's turn hands off to stall or transient recovery, the submission stays
runninguntil recovery finishes it. Before, the submission runner recorded the handed-off attempt asaborted, and recovery then skipped it assubmission_not_running.