GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — fix(core): ungate failover from the retry hook and walk credentials in proximity order (#1379) by dezren39 · Pull Request #1392 · developing-today-forks/opencode Conversation
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Track credentials across fallback retries packages/core/src/model-resolver.ts, packages/core/test/model-resolver.test.ts |
Credential fallback records tried credentials and excludes them from later attempts. The test verifies that fallback does not reactivate a previously served credential. |
Continue credential failover before route fallback packages/core/src/session/runner/step.ts, packages/core/test/session-step.test.ts, packages/core/test/session-runner.test.ts |
Routed-session failover no longer depends on retry-hook approval or a one-switch limit. Tests cover successive credential switches, route fallback, and quota failure after partial output. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
sequenceDiagram
participant SessionRunnerStep
participant credentialFallback
participant RouteFallback
SessionRunnerStep->>credentialFallback: Try an eligible credential after quota failure
credentialFallback-->>SessionRunnerStep: Return switched resolution
SessionRunnerStep->>credentialFallback: Try another credential after a later quota failure
credentialFallback-->>SessionRunnerStep: Return no eligible credential
SessionRunnerStep->>RouteFallback: Continue to route fallback
Suggested reviewers: kitlangton, rekram1-node
3e0f5The credential walk and routed failover have no identified merge-blocking issue; merge after normal checks.
Explanation
The description explains the problem, implementation, retained safeguards, linked issues, and verification results. It omits the template's Type of change and Checklist sections, but the required technical context is otherwise substantially complete.
Explanation
The PR satisfies the coding requirements in #1379. step.ts no longer requires retry?.retry for route failover. It retains the outputStarted gate and adds a test for the intended post-output cascade. Credential fallback now tracks served credentials in model-resolver.ts, and session-step.test.ts verifies that repeated quota failures try the next same-provider credentials before route fallback. The reported session-runner and model-resolver suites pass. Closed #1014 supplies context only.
Explanation
The changed production files and tests directly implement #1379. The removed switch-cap helpers, credential-chain tracking, failover logic, and related test updates support the requested failover and credential proximity behavior. No unrelated change is demonstrated.
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 5 files.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 5571ec0775
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (isQuotaFailure(llmFailure) && input.model.routing.credentialFallback) { | ||
| const switched = yield* Effect.result(input.model.routing.credentialFallback()) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Track attempted credentials across the failover chain
When HTTP 429 responses specify a short retryAfterMs and subsequent requests take longer than that cooldown, this can cycle between credentials indefinitely instead of reaching the backup target. In model-resolver.ts, credentialFallback excludes only the currently serving credential and credentials whose health/quota holds are still active; it does not remember previously attempted credentials. Consequently, an earlier credential becomes eligible again before the next switch. Plain RateLimit failures also do not accumulate quota demotion, and the newly ungated failover continues even after the retry policy exhausts its allowance. Preserve a chain-local set of attempted credentials so each is tried once before route fallback.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3e0f57d. credentialFallback in model-resolver.ts now carries a chain-local attempted set: each switched resolution excludes every credential the chain has already served (not just its own serving credential), so a credential whose short retryAfterMs cooldown expires mid-chain cannot be re-selected and the walk cannot cycle between two credentials — each is tried at most once per chain before route fallback runs. A fresh resolution starts a fresh chain. The model-resolver test that expected rotation back to cred-a (it relied on the removed per-message cap) now pins the new behavior: the second fallback returns undefined. Tests: model-resolver + session-step 108 pass, session-runner + session-step-failure + model-route 358 pass, tsgo -b clean. Branch also merged current main (incl. #1393/#1380).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…r-policy # Conflicts: # packages/core/src/session/runner/step.ts
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
fix(core): #1014 runner policy — step.ts failover gates (retry/outputStarted) and credential-switch proximity order ensure(core+openchamber): repeated errors of ANY class remove a model from rotation for escalating time, or until its expected resolution
There was an error while loading. Please reload this page.