GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(routes): thread the credential dimension through restore, escalation, ranking, rate-limit holds and catalog headers (PR #854 follow-up) · Issue #870 · developing-today-forks/opencode

fix(routes): thread the credential dimension through restore, escalation, ranking, rate-limit holds and catalog headers (PR #854 follow-up) #870

New issue
Copy link
New issue
Copy link
Closed
#920
Closed
fix(routes): thread the credential dimension through restore, escalation, ranking, rate-limit holds and catalog headers (PR #854 follow-up)#870
#920
Copy link
Labels
app/corePackage: core (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)status:done

Description

@dezren39
dezren39
opened on Oct 29, 2026
Issue body actions

Follow-up to PR #854 (credential failover, merged for #6). Five Codex P2 findings were unresolved at merge. Each is a place where a credential dimension was added locally but not threaded through a consumer, so the per-credential state exists yet some paths still read target-wide state.

All five are consistency/correctness edges of the new feature rather than regressions to previous behavior; they do not block the merge gate, but they should be closed before the credential dimension is relied on.

Findings

  1. Restart replay benches the whole target — packages/core/src/model-route.ts:343. ModelRouteLog.restoreCooldownsFrom groups health records by provider/model only and ignores credential:<id> in the reason, so a credential-specific cooldown-start is restored as a target-wide cooldown. If credential A exhausts quota, failover moves to B, and the server restarts before A's cooldown expires, healthy B is excluded from normal routing.
    Expect: preserve the credential dimension on restore; only the benched credential is excluded.

  2. Adaptive escalation never sees credential failures — model-route.ts:381. For stored-credential targets the failure is recorded only in credentialHealth, while giveUps, steady, and escalates still read target health. Repeated provider failures leave the target "steady" indefinitely, so SessionStep.attempt never enables adaptive immediate hedging and the retry branch keeps granting the steady-target retry.
    Expect: cooldown isolation stays, but the serving credential's failure history is visible to those consumers.

  3. Quota demotion skipped in normal selection — model-route.ts:463. tracedWeightOf, nextTarget, keepsThrough call demoted(target) without a credential, so credential-qualified quota events are invisible. Once cooldown expires the exhausted active credential regains its original rank instead of staying demoted for the configured quota window.
    Expect: thread the active credential through normal selection, not only credentialFallback candidates.

  4. Rate-limit hold leaks across credentials — model-resolver.ts:631-634. captureRateLimit / the failure path call ModelRoute.observeRateLimit without a credential dimension and limits stays keyed by provider/model. A's 429 Retry-After survives the switch to B, and if B's success carries no rate-limit headers the hold is never replaced, so limitedUntil(target) keeps excluding B until A's reset.
    Expect: scope holds to the serving credential.

  5. Retried request mixes accounts — model-resolver.ts:631. On a switch between stored ChatGPT OAuth credentials for different accounts, source.headers still carries account A's chatgpt-account-id; the retry combines B's token with A's header and can fail authentication.
    Expect: refresh account-specific catalog metadata (or re-derive headers) after activation, before re-issuing.

Acceptance

  • Restart-restored cooldowns are per credential; a healthy alternate credential is still routable after restart.
  • Credential failure history feeds adaptive escalation/hedging decisions.
  • Credential-qualified quota demotion applies in ranking and stickiness, not only in fallback candidate selection.
  • Rate-limit holds are per credential and clear for a credential that succeeds without limit headers.
  • Account-scoped headers follow the activated credential on retry.
  • New tests cover each case; existing model-route / model-resolver / session-runner suites pass.

Merged PR: #854 (head ee8bf2e12a). Source: Codex review comments on that PR.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    app/corePackage: core (pkgs/ or apps/ in this repo)
    work/assignedAn agent holds this item via the queue (claimed task)
    on Oct 29, 2026
  2. developing-today commented on Oct 29, 2026

    @developing-today
    developing-todayBot
    on Oct 29, 2026 – with developing.today
    More actions

    OPENCODE-208

  3. dezren39
    added
    effort/mMedium: expected under 1 day of work
    queue/queuedHas a queued task in the Supabase agent queue
    status/needs-triageNot yet triaged; needs a first look
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    status/in-progressActively being worked
    and removed
    work/assignedAn agent holds this item via the queue (claimed task)
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 29, 2026
  4. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    Author
    More actions

    Dependency note from queue task 3416 (lane A): this follow-up cannot be implemented yet — PR #854 is still OPEN (head ee8bf2e, branch queue/3290-6-credential-failover, CI queued), not merged as the issue text states. The credential-dimension code it threads through (credentialHealth, per-credential cooldown reasons in model-route.ts / model-resolver.ts) exists only on that branch; current main has none of it. PR #854 is owned by queue task 3290 via issue #6 (parked awaiting its CI; #6 also carries user/review). Task 3416 is parked and resumes once PR #854 merges to main: then implement the five findings against the merged code, in the files/tests named in the issue.

  5. 14 remaining items

  6. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    Author
    More actions

    Dependency update: PR #854 merged 2026-10-29T18:13Z (merge commit 427f20399e, verified fresh), so this task is unblocked and ready to implement against current main. Task 3416 is parked ready-to-implement with the five findings itemised as the resume brief; it needs a full shift (medium risk, ~45-min timebox).

  7. dezren39
    added
    queue/claimedA queue worker has claimed the task for this item
    status/in-progressActively being worked
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 29, 2026
  8. developing-today
    added
    status:in-review
    on Oct 29, 2026
  9. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    Author
    More actions

    Implementation opened as PR #920 (branch queue/3416-870-credential-threading, commit 86b4f41): all five credential-threading findings addressed — per-credential restore in restoreCooldownsFrom/seedCooldowns/seedLimits, credential-aware giveUps/steady/escalates wired through the session runner, credential-qualified demotion in tracedWeightOf/nextTarget/keepsThrough via the resolver, per-credential rate-limit holds with per-credential clearing on headerless success, and chatgpt-account-id re-derived from the activated credential in credentialFallback. Local verification: model-route-credential+limits 34 pass, model-route-log 26 pass, model-resolver 66 pass, model-route* 195 pass, session-runner* 182 pass, core typecheck + oxlint clean. Awaiting CI on the PR.

  10. dezren39
    added 2 commits that reference this issue on Oct 29, 2026

    chore(core): update proto-reads allowlist for the credential-threaded…

    6674d62

    fix(core): disposition PR #920 review findings — successful-stream ho…

    c2b2250
  11. dezren39
    closed this as completedin #920on Oct 29, 2026
  12. developing-today
    added
    status:done
    and removed
    status:in-review
    on Oct 29, 2026
  13. dezren39
    removed
    status/in-progressActively being worked
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/corePackage: core (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)status:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.