Skip to content

fix(auth): exclude local CLI providers from tokenHealthCheck expiration (Fixes #8407) - #8426

Merged
diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.49from
MumuTW:fix/health-check-local-cli-providers
Jul 25, 2026
Merged

diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.49from
MumuTW:fix/health-check-local-cli-providers

Conversation

@MumuTW

@MumuTW MumuTW commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #8407

devin-cli is a local import-token / CLI-owned provider (devin auth login). It never carries a refresh token, but it was listed in supportsTokenRefresh()'s explicitlySupported set. That made the token health sweep treat it as refresh-capable and write terminal testStatus="expired" / errorCode="no_refresh_token", after which routing failed with No active credentials for provider: devin-cli.

Changes

  1. Root fix — remove "devin-cli" from explicitlySupported in open-sse/services/tokenRefresh.ts (keep windsurf). The existing supportsTokenRefresh=false guard in tokenHealthCheck then skips the expiry write.
  2. No provider hardcode in tokenHealthCheck — one source of truth is enough.
  3. Unit tests — assert supportsTokenRefresh("devin-cli") === false, and that checkConnection leaves a no-refresh-token devin-cli connection active.

Test plan

  • node --import tsx --test tests/unit/token-health-check-devin-cli-8407.test.ts → 2/2 pass
  • Manual: add Devin CLI provider → wait for health sweep → connection stays active / routable

Related

@MumuTW
MumuTW requested a review from diegosouzapw as a code owner July 24, 2026 12:57
…aper-inference#8407)

Root cause: listing "devin-cli" as refresh-capable made tokenHealthCheck
force-expire local CLI connections that never have a refresh token.

Remove it from the explicit set (keep windsurf) and drop the health-check
provider hardcode — the existing supportsTokenRefresh=false guard is enough.
@MumuTW

MumuTW commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up push (d0f15f8): switched to the clean root fix.

  • Removed devin-cli from explicitlySupported in tokenRefresh.ts
  • Removed the authenticatesViaLocalCli hardcode from tokenHealthCheck.ts (redundant once supportsTokenRefresh is false)
  • Tests 2/2 pass locally

Ready for review.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks for the clean fix and for following up with the root-cause version after the discussion on #8407 — this matches the approach we confirmed there (drop devin-cli from supportsTokenRefresh()'s explicit set so the existing supportsTokenRefresh=false guard in tokenHealthCheck handles it, no per-provider hardcode). Verified locally: both new tests pass, lint is clean, and the two commits net out to exactly that single-source-of-truth change with no leftover hardcode.

One thing we noticed while reviewing: windsurf shares the same import-token mapTokens() (which always returns refreshToken: null) as devin-cli, and is still listed in explicitlySupported — so a fresh windsurf connection today hits the identical force-expired bug. That's outside the scope of this PR (and not something you introduced), so we're not asking you to change anything here — we'll track it as a separate follow-up. Merging this as-is.

@diegosouzapw
diegosouzapw merged commit 4528fc4 into cheaper-inference:release/v3.8.49 Jul 25, 2026
3 checks passed
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Merged into release/v3.8.49 — thanks @MumuTW! Validated via a 26-PR local merge-train + per-file discriminator confirming zero regressions vs the pure release tip. 🙏

MumuTW added a commit to MumuTW/OmniRoute that referenced this pull request Jul 25, 2026
… to fit frozen file-size baseline

The 3-line comment added by cheaper-inference#8426 pushed tokenHealthCheck.ts to 843 LOC,
2 over its frozen baseline of 841 (base-red on release/v3.8.49). Fold the
devin-cli rationale into one line — same meaning, gate green again.
diegosouzapw pushed a commit to fenix007/OmniRoute that referenced this pull request Jul 25, 2026
check:file-size fails on the pristine release/v3.8.49 tip (3070925),
which takes the whole Fast Quality Gates job down for every PR against
the branch. Both offenders grew after the last rebaseline
(_rebaseline_2026_07_25_v3849_basered_filesize, measured at 36f8fd1)
and both came from already-merged PRs, so there is no offending branch
left to fix:

  src/lib/tokenHealthCheck.ts                     841 -> 843  (cheaper-inference#8426, 4528fc4)
  src/app/(dashboard)/dashboard/providers/page.tsx 1927 -> 1990 (cheaper-inference#8349, 58ab8b1)

Trust-but-verify: both values measured on the pristine tip with an empty
working tree. Same situation and remedy as the entry cited above and as
_rebaseline_2026_07_02_5798_release_green.

This commit is deliberately last and self-contained: drop it if the
captain would rather move the frozen values separately. Structural
reduction of the 1990-line providers page is not attempted here.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
diegosouzapw pushed a commit that referenced this pull request Jul 25, 2026
check:file-size fails on the pristine release/v3.8.49 tip (3070925),
which takes the whole Fast Quality Gates job down for every PR against
the branch. Both offenders grew after the last rebaseline
(_rebaseline_2026_07_25_v3849_basered_filesize, measured at 36f8fd1)
and both came from already-merged PRs, so there is no offending branch
left to fix:

  src/lib/tokenHealthCheck.ts                     841 -> 843  (#8426, 4528fc4)
  src/app/(dashboard)/dashboard/providers/page.tsx 1927 -> 1990 (#8349, 58ab8b1)

Trust-but-verify: both values measured on the pristine tip with an empty
working tree. Same situation and remedy as the entry cited above and as
_rebaseline_2026_07_02_5798_release_green.

This commit is deliberately last and self-contained: drop it if the
captain would rather move the frozen values separately. Structural
reduction of the 1990-line providers page is not attempted here.

Co-authored-by: alexey.nazarov@softmg.ru <alexey.nazarov@softmg.ru>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
diegosouzapw pushed a commit that referenced this pull request Jul 26, 2026
…card highlight wiring (#8524)

* chore(auth): condense #8407 note in tokenHealthCheck to fit frozen file-size baseline

The 3-line comment added by #8426 pushed tokenHealthCheck.ts to 843 LOC,
2 over its frozen baseline of 841 (base-red on release/v3.8.49). Fold the
devin-cli rationale into one line — same meaning, gate green again.

* refactor(dashboard): extract provider card highlight into HighlightableProviderCard

#8349 left the back-navigation highlight concern inline in providers/page.tsx
(state + two callbacks + onCardClick/ref props repeated at 18 card call
sites), pushing the page to 1990 LOC over its frozen baseline of 1927.

Move the concern into a HighlightableProviderCard wrapper: each card instance
keeps its own copy of the highlighted id and only the card whose provider id
matches scrolls into view and highlights — same semantics as the single
page-level state, since resolveHighlightedCard already gates on the id match.

page.tsx drops to 1917 LOC (under the frozen baseline, no rebaseline needed).

* test(dashboard): cover HighlightableProviderCard wiring

Direct coverage for the wrapper extracted in the previous refactor:
mount-time scroll+highlight only when history.state.providerId matches,
no reaction on mismatch/null state, isolation across multiple card
instances, and click-time navigation recording via history.replaceState.

Note: the jsdom scrollIntoView shim is a plain no-op rather than a
vi.fn() — vi.restoreAllMocks() would otherwise restore the shared mock
and let the next test's spy inherit its accumulated call count.
@diegosouzapw diegosouzapw mentioned this pull request Jul 28, 2026
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…on (Fixes cheaper-inference#8407) (cheaper-inference#8426)

* fix(providers): prevent health sweep from expiring devin-cli local credentials

* fix(auth): drop devin-cli from supportsTokenRefresh explicit set (cheaper-inference#8407)

Root cause: listing "devin-cli" as refresh-capable made tokenHealthCheck
force-expire local CLI connections that never have a refresh token.

Remove it from the explicit set (keep windsurf) and drop the health-check
provider hardcode — the existing supportsTokenRefresh=false guard is enough.
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…er-inference#8561)

check:file-size fails on the pristine release/v3.8.49 tip (df69bd1),
which takes the whole Fast Quality Gates job down for every PR against
the branch. Both offenders grew after the last rebaseline
(_rebaseline_2026_07_25_v3849_basered_filesize, measured at d61504d)
and both came from already-merged PRs, so there is no offending branch
left to fix:

  src/lib/tokenHealthCheck.ts                     841 -> 843  (cheaper-inference#8426, 903ecfa)
  src/app/(dashboard)/dashboard/providers/page.tsx 1927 -> 1990 (cheaper-inference#8349, e62c217)

Trust-but-verify: both values measured on the pristine tip with an empty
working tree. Same situation and remedy as the entry cited above and as
_rebaseline_2026_07_02_5798_release_green.

This commit is deliberately last and self-contained: drop it if the
captain would rather move the frozen values separately. Structural
reduction of the 1990-line providers page is not attempted here.

Co-authored-by: alexey.nazarov@softmg.ru <alexey.nazarov@softmg.ru>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…card highlight wiring (cheaper-inference#8524)

* chore(auth): condense cheaper-inference#8407 note in tokenHealthCheck to fit frozen file-size baseline

The 3-line comment added by cheaper-inference#8426 pushed tokenHealthCheck.ts to 843 LOC,
2 over its frozen baseline of 841 (base-red on release/v3.8.49). Fold the
devin-cli rationale into one line — same meaning, gate green again.

* refactor(dashboard): extract provider card highlight into HighlightableProviderCard

cheaper-inference#8349 left the back-navigation highlight concern inline in providers/page.tsx
(state + two callbacks + onCardClick/ref props repeated at 18 card call
sites), pushing the page to 1990 LOC over its frozen baseline of 1927.

Move the concern into a HighlightableProviderCard wrapper: each card instance
keeps its own copy of the highlighted id and only the card whose provider id
matches scrolls into view and highlights — same semantics as the single
page-level state, since resolveHighlightedCard already gates on the id match.

page.tsx drops to 1917 LOC (under the frozen baseline, no rebaseline needed).

* test(dashboard): cover HighlightableProviderCard wiring

Direct coverage for the wrapper extracted in the previous refactor:
mount-time scroll+highlight only when history.state.providerId matches,
no reaction on mismatch/null state, isolation across multiple card
instances, and click-time navigation recording via history.replaceState.

Note: the jsdom scrollIntoView shim is a plain no-op rather than a
vi.fn() — vi.restoreAllMocks() would otherwise restore the shared mock
and let the next test's spy inherit its accumulated call count.
@MumuTW
MumuTW deleted the fix/health-check-local-cli-providers branch September 5, 2026 10:19
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…on (Fixes cheaper-inference#8407) (cheaper-inference#8426)

* fix(providers): prevent health sweep from expiring devin-cli local credentials

* fix(auth): drop devin-cli from supportsTokenRefresh explicit set (cheaper-inference#8407)

Root cause: listing "devin-cli" as refresh-capable made tokenHealthCheck
force-expire local CLI connections that never have a refresh token.

Remove it from the explicit set (keep windsurf) and drop the health-check
provider hardcode — the existing supportsTokenRefresh=false guard is enough.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…er-inference#8561)

check:file-size fails on the pristine release/v3.8.49 tip (400757e),
which takes the whole Fast Quality Gates job down for every PR against
the branch. Both offenders grew after the last rebaseline
(_rebaseline_2026_07_25_v3849_basered_filesize, measured at 75eb952)
and both came from already-merged PRs, so there is no offending branch
left to fix:

  src/lib/tokenHealthCheck.ts                     841 -> 843  (cheaper-inference#8426, 35b6719)
  src/app/(dashboard)/dashboard/providers/page.tsx 1927 -> 1990 (cheaper-inference#8349, 17aed5f)

Trust-but-verify: both values measured on the pristine tip with an empty
working tree. Same situation and remedy as the entry cited above and as
_rebaseline_2026_07_02_5798_release_green.

This commit is deliberately last and self-contained: drop it if the
captain would rather move the frozen values separately. Structural
reduction of the 1990-line providers page is not attempted here.

Co-authored-by: alexey.nazarov@softmg.ru <alexey.nazarov@softmg.ru>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…card highlight wiring (cheaper-inference#8524)

* chore(auth): condense cheaper-inference#8407 note in tokenHealthCheck to fit frozen file-size baseline

The 3-line comment added by cheaper-inference#8426 pushed tokenHealthCheck.ts to 843 LOC,
2 over its frozen baseline of 841 (base-red on release/v3.8.49). Fold the
devin-cli rationale into one line — same meaning, gate green again.

* refactor(dashboard): extract provider card highlight into HighlightableProviderCard

cheaper-inference#8349 left the back-navigation highlight concern inline in providers/page.tsx
(state + two callbacks + onCardClick/ref props repeated at 18 card call
sites), pushing the page to 1990 LOC over its frozen baseline of 1927.

Move the concern into a HighlightableProviderCard wrapper: each card instance
keeps its own copy of the highlighted id and only the card whose provider id
matches scrolls into view and highlights — same semantics as the single
page-level state, since resolveHighlightedCard already gates on the id match.

page.tsx drops to 1917 LOC (under the frozen baseline, no rebaseline needed).

* test(dashboard): cover HighlightableProviderCard wiring

Direct coverage for the wrapper extracted in the previous refactor:
mount-time scroll+highlight only when history.state.providerId matches,
no reaction on mismatch/null state, isolation across multiple card
instances, and click-time navigation recording via history.replaceState.

Note: the jsdom scrollIntoView shim is a plain no-op rather than a
vi.fn() — vi.restoreAllMocks() would otherwise restore the shared mock
and let the next test's spy inherit its accumulated call count.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(providers): token health-check marks local-CLI providers expired every sweep, making devin-cli unroutable within 60s

2 participants