Repository navigation
feat(retry): align retry policy with upstream session/retry.ts (default 3, cap 5) - #7
Merged
Merged
Conversation
…ession-rotation guard
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.
設計語義
n = OPENCODE_PROXY_RETRY_MAX_RETRIES(env)/RETRY_MAX_RETRIES(config.json),resolveMaxRetries()解析:缺省/非法→3,floor,clamp[0,5]。1+n:maxAttempts = maxRetries + 1,每次重試開新 session(舊 errored assistant message 不复用)。computeRetryDelay(attempt),attempt1-based(第 2 次總嘗試前等待 ≈2s)。官方對照表(upstream
session/retry.ts)retry-after-ms>retry-after(秒) > HTTP date5xx/isRetryable強制重試ContextOverflow永不重試RETRY_MAX_RETRIES上限與官方的差異點(deliberate)
MAX_HEADER_DELAY_MS=30s截斷。見src/retry/policy.js頭註解。預設行為變化(舊部署必讀)
OPENCODE_PROXY_RETRY_MAX_RETRIES=2(退避曲線無 knob 可還原)。OPENCODE_PROXY_RETRY_MAX_RETRIES=0(單次嘗試;注意比舊行為更嚴格)。覆蓋範圍
167 passed, 5 suites;新增 15(retry-policy11 + 接線 4)。Rollback
git revert <merge-sha>即可,無 migration。