Repository navigation
Conversation
Two optional numeric settings customize the shared provider retry machinery without removing its guard rails: - providerRetryMaxAttempts: any non-negative integer ceiling shared by the 429 and transient budgets; 0 means unlimited, exactly like the infiniteProviderRetry switch, which keeps winning over any value. - providerRetryInitialDelayMs: any non-negative first-retry wait in milliseconds; 0 retries immediately. Later retries still double from it, and the exponential cap rises with it (max of shipped cap and the configured wait), so long custom intervals are honored, never truncated. Server Retry-After keeps precedence in both backoffs. Both fields normalize on read and validate on write at renderer and main boundaries; junk values drop back to shipped defaults. The retrying activity now reports the effective ceiling (maxAttempts) so transcript status reflects the configured budget, and turning infiniteProviderRetry back off restores the configured ceiling. The stream-retry adapter receives the custom pacing through its controller, and live session reuse updates it via setProviderRetryPolicy.
shabhui
force-pushed
the
feat/provider-retry-interval
branch
from
October 4, 2026 06:37
2585dbf to
7e49172
Compare
This branch has not been deployed
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.
Summary
Adds two optional numeric settings that customize the shared provider retry machinery (429 rate-limit and transient-failure budgets) without removing its guard rails:
providerRetryMaxAttempts— any non-negative integer ceiling shared by both budgets.0means unlimited, exactly like the existinginfiniteProviderRetryswitch; the switch keeps winning over any configured value.** — any non-negative first-retry wait in milliseconds.0retries immediately. Later retries keep doubling from it, and the exponential cap rises with it (max(shipped cap, configured wait)), so a long custom interval is honored rather than truncated. ServerRetry-After` keeps precedence in both backoffs.Design notes
retryingactivity now carries the effective ceiling (maxAttempts), so the transcript status showsattempt 3/7instead of the hardcoded/10; unlimited shows∞.infiniteProviderRetryback off restores the configured ceiling (the switch no longer pins the internal budget to 0), and live session reuse updates the policy through the newsetProviderRetryPolicy.initialDelayMscontroller hook, so pre-stream and mid-stream retries share one pacing.Files
packages/shared: retry settings type + normalize helpers + retrying-activitymaxAttemptsfield.packages/agent-runtime: budget checks honor the ceiling (0 = unlimited); both delay functions acceptinitialDelayMsand raise their caps; sidecar reuses/constructs with the policy.apps/desktop: settings UI rows (General, next to the infinite-retry switch), write validation on both boundaries, transcript retry status, settings search keys.packages/i18n: 9 locales.03-runtime/02-agent-runtime.md) updated in en + zh-CN.Test plan
packages/sharedvitest: 1176 passed (4 new normalize cases)packages/agent-runtimeprovider-retry.test.ts: 48 passed (5 new custom-pacing cases: scaling, cap raising, Retry-After precedence, zero-immediate, jitter)packages/agent-runtimeruntime.test.ts: 276 passed (new: smaller custom ceiling across both budgets, zero-ceiling unlimited, toggle-off restores ceiling, retrying activity reports maxAttempts)apps/desktopsettings-roundtrip.test.mjs: 5 passed (round-trip of both fields incl. 0/0, junk rejection at both boundaries, renderer drops stored junk)tsc -p tsconfig.json --noEmitclean for agent-runtime and desktopCloses #759 follow-up territory: gives finite custom ceilings and pacing instead of only the unlimited boolean.