fix(providers): limit Gemini CLI to legacy OAuth refresh - #8275
Merged
diegosouzapw merged 1 commit intoJul 23, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
backryun
marked this pull request as ready for review
July 23, 2026 12:04
backryun
force-pushed
the
agent/remove-gemini-cli-provider
branch
from
July 23, 2026 12:16
eaf479c to
db2d307
Compare
diegosouzapw#8232 correctly targeted OAuth auto-refresh for legacy stored Gemini CLI connections, but exceeded that compatibility goal by recreating a complete routable and UI-visible provider with an Antigravity model catalog. Preserve legacy refresh by mapping gemini-cli rows to the existing Gemini OAuth credentials. Remove the public provider registry, OAuth preset, model routing snapshot, and canonical-provider tests while keeping Gemini API and Antigravity unchanged.
backryun
force-pushed
the
agent/remove-gemini-cli-provider
branch
from
July 23, 2026 12:41
db2d307 to
36a5260
Compare
Owner
|
Thanks, @backryun! 🙏 Merged — limits Gemini CLI to the legacy OAuth refresh path. gemini-cli tests green on the merge-train. |
This was referenced Jul 28, 2026
Merged
diegosouzapw
added a commit
that referenced
this pull request
Jul 30, 2026
…ration path (#8980) * feat(sse): deprecate the gemini-cli upstream provider with a real migration path Stored `gemini-cli` connections were being kept alive for nothing. Measured before touching anything: routable? absent from PROVIDERS, from REGISTRY, from OAUTH_PROVIDERS, and no executor references it → the connection can NEVER serve a request refreshing? yes, and successfully — it redeemed against PROVIDERS.gemini's client (681255809395-oo8ft2o…), the same public Gemini CLI / Code Assist OAuth client So the scheduler made periodic upstream calls to Google to keep a credential fresh that had nowhere to go. That is the waste this removes. This is a deprecation, not a deletion, and the difference is deliberate. The path was not dead code: #8232 added it after a user report (the UI advertises automatic OAuth rotation and these rows never rotated), and #8275 narrowed it to exactly the legacy refresh. Simply dropping it from `supportsTokenRefresh` would have produced a SILENT skip — `Skipping … (refresh unsupported)` — leaving the row at "active" forever, doing nothing. Worse than before. Instead: DEPRECATED_PROVIDERS + isDeprecatedProvider/getDeprecationNotice in tokenRefresh one place naming the provider and where to migrate. A test asserts the migration target is itself routable, so the notice can never point somewhere useless. _getAccessTokenInternal returns the ESTABLISHED unrecoverable envelope { error: "unrecoverable_refresh_error", code: "provider_deprecated", migrateTo } Reusing `error` means isUnrecoverableRefreshError and the manual-refresh route already stop retrying — no new contract for callers to learn. The distinct `code` is what makes it legible. A bare `null` would read as transient and retry forever. tokenHealthCheck marks the connection terminal with the reason Placed after the existing terminal-status guard, which makes it idempotent for free: once "expired", later sweeps skip the row, so it writes once instead of rewriting the same reason every cycle. the manual-refresh route stops lying It said "Refresh token expired. Please re-authenticate this account." — false here: the token is fine, the provider is gone. Re-authenticating would loop against something that no longer exists. It now reports the deprecation and the migration target. `gemini` uses the same OAuth client, so re-adding the account there is a working path, not advice to start over. Deliberately NOT touched: Category A — the gemini-cli CLIENT identity (#7034): clientIdentityProfiles.ts, clientApi.ts, googApiKeyAuth.ts. Same string, opposite direction — requests ARRIVING from the Gemini CLI, where OmniRoute is the server. Deleting these is the failure this change must never cause, so a test now asserts the profile survives. Audited: `git diff --name-only` touches none of those files. errorClassifier.ts's isCloudCodeProvider list still names gemini-cli. It is a defensive 403→PROJECT_ROUTE_ERROR list shared with cloudcode/cloud-code; the entry is unreachable for a non-routable provider, and editing a shared classification path for a dead string is risk without upside. Tests — 42 across the six files that mention the identifier, all green: gemini-cli-legacy-refresh.test.ts 5 (3 assertions REWRITTEN, see below) gemini-cli-deprecation.test.ts 5 (new) client-identity-profiles.test.ts 9 (category A, untouched) service-token-refresh.test.ts 14 errorclassifier-antigravity-403.test.ts 4 gemini-cli-ansi-sanitization.test.ts 5 (category C, untouched) The three rewritten assertions in the legacy file are alignment, not weakening, and the gate is right to ask: each is now STRONGER. "refresh succeeds against Google's token endpoint" became "zero upstream calls happen at all"; "a 400 surfaces invalid_grant" became "the envelope is unchanged but the code says provider_deprecated" plus a control asserting `gemini` still reports invalid_grant, proving the real path was not blunted. The file's header keeps the whole #8232 → #8275 → deprecation arc, because each step is why the next made sense. Count unchanged; no test deleted, so no allowlist entry needed. * docs(changelog): fragment for #8980 --------- Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
HouMinXi
pushed a commit
to HouMinXi/OmniRoute
that referenced
this pull request
Aug 2, 2026
…ration path (diegosouzapw#8980) * feat(sse): deprecate the gemini-cli upstream provider with a real migration path Stored `gemini-cli` connections were being kept alive for nothing. Measured before touching anything: routable? absent from PROVIDERS, from REGISTRY, from OAUTH_PROVIDERS, and no executor references it → the connection can NEVER serve a request refreshing? yes, and successfully — it redeemed against PROVIDERS.gemini's client (681255809395-oo8ft2o…), the same public Gemini CLI / Code Assist OAuth client So the scheduler made periodic upstream calls to Google to keep a credential fresh that had nowhere to go. That is the waste this removes. This is a deprecation, not a deletion, and the difference is deliberate. The path was not dead code: diegosouzapw#8232 added it after a user report (the UI advertises automatic OAuth rotation and these rows never rotated), and diegosouzapw#8275 narrowed it to exactly the legacy refresh. Simply dropping it from `supportsTokenRefresh` would have produced a SILENT skip — `Skipping … (refresh unsupported)` — leaving the row at "active" forever, doing nothing. Worse than before. Instead: DEPRECATED_PROVIDERS + isDeprecatedProvider/getDeprecationNotice in tokenRefresh one place naming the provider and where to migrate. A test asserts the migration target is itself routable, so the notice can never point somewhere useless. _getAccessTokenInternal returns the ESTABLISHED unrecoverable envelope { error: "unrecoverable_refresh_error", code: "provider_deprecated", migrateTo } Reusing `error` means isUnrecoverableRefreshError and the manual-refresh route already stop retrying — no new contract for callers to learn. The distinct `code` is what makes it legible. A bare `null` would read as transient and retry forever. tokenHealthCheck marks the connection terminal with the reason Placed after the existing terminal-status guard, which makes it idempotent for free: once "expired", later sweeps skip the row, so it writes once instead of rewriting the same reason every cycle. the manual-refresh route stops lying It said "Refresh token expired. Please re-authenticate this account." — false here: the token is fine, the provider is gone. Re-authenticating would loop against something that no longer exists. It now reports the deprecation and the migration target. `gemini` uses the same OAuth client, so re-adding the account there is a working path, not advice to start over. Deliberately NOT touched: Category A — the gemini-cli CLIENT identity (diegosouzapw#7034): clientIdentityProfiles.ts, clientApi.ts, googApiKeyAuth.ts. Same string, opposite direction — requests ARRIVING from the Gemini CLI, where OmniRoute is the server. Deleting these is the failure this change must never cause, so a test now asserts the profile survives. Audited: `git diff --name-only` touches none of those files. errorClassifier.ts's isCloudCodeProvider list still names gemini-cli. It is a defensive 403→PROJECT_ROUTE_ERROR list shared with cloudcode/cloud-code; the entry is unreachable for a non-routable provider, and editing a shared classification path for a dead string is risk without upside. Tests — 42 across the six files that mention the identifier, all green: gemini-cli-legacy-refresh.test.ts 5 (3 assertions REWRITTEN, see below) gemini-cli-deprecation.test.ts 5 (new) client-identity-profiles.test.ts 9 (category A, untouched) service-token-refresh.test.ts 14 errorclassifier-antigravity-403.test.ts 4 gemini-cli-ansi-sanitization.test.ts 5 (category C, untouched) The three rewritten assertions in the legacy file are alignment, not weakening, and the gate is right to ask: each is now STRONGER. "refresh succeeds against Google's token endpoint" became "zero upstream calls happen at all"; "a 400 surfaces invalid_grant" became "the envelope is unchanged but the code says provider_deprecated" plus a control asserting `gemini` still reports invalid_grant, proving the real path was not blunted. The file's header keeps the whole diegosouzapw#8232 → diegosouzapw#8275 → deprecation arc, because each step is why the next made sense. Count unchanged; no test deleted, so no allowlist entry needed. * docs(changelog): fragment for diegosouzapw#8980 --------- Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
HouMinXi
pushed a commit
to HouMinXi/OmniRoute
that referenced
this pull request
Aug 2, 2026
…w#8275) diegosouzapw#8232 correctly targeted OAuth auto-refresh for legacy stored Gemini CLI connections, but exceeded that compatibility goal by recreating a complete routable and UI-visible provider with an Antigravity model catalog. Preserve legacy refresh by mapping gemini-cli rows to the existing Gemini OAuth credentials. Remove the public provider registry, OAuth preset, model routing snapshot, and canonical-provider tests while keeping Gemini API and Antigravity unchanged.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…w#8275) diegosouzapw#8232 correctly targeted OAuth auto-refresh for legacy stored Gemini CLI connections, but exceeded that compatibility goal by recreating a complete routable and UI-visible provider with an Antigravity model catalog. Preserve legacy refresh by mapping gemini-cli rows to the existing Gemini OAuth credentials. Remove the public provider registry, OAuth preset, model routing snapshot, and canonical-provider tests while keeping Gemini API and Antigravity unchanged.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…ration path (diegosouzapw#8980) * feat(sse): deprecate the gemini-cli upstream provider with a real migration path Stored `gemini-cli` connections were being kept alive for nothing. Measured before touching anything: routable? absent from PROVIDERS, from REGISTRY, from OAUTH_PROVIDERS, and no executor references it → the connection can NEVER serve a request refreshing? yes, and successfully — it redeemed against PROVIDERS.gemini's client (681255809395-oo8ft2o…), the same public Gemini CLI / Code Assist OAuth client So the scheduler made periodic upstream calls to Google to keep a credential fresh that had nowhere to go. That is the waste this removes. This is a deprecation, not a deletion, and the difference is deliberate. The path was not dead code: diegosouzapw#8232 added it after a user report (the UI advertises automatic OAuth rotation and these rows never rotated), and diegosouzapw#8275 narrowed it to exactly the legacy refresh. Simply dropping it from `supportsTokenRefresh` would have produced a SILENT skip — `Skipping … (refresh unsupported)` — leaving the row at "active" forever, doing nothing. Worse than before. Instead: DEPRECATED_PROVIDERS + isDeprecatedProvider/getDeprecationNotice in tokenRefresh one place naming the provider and where to migrate. A test asserts the migration target is itself routable, so the notice can never point somewhere useless. _getAccessTokenInternal returns the ESTABLISHED unrecoverable envelope { error: "unrecoverable_refresh_error", code: "provider_deprecated", migrateTo } Reusing `error` means isUnrecoverableRefreshError and the manual-refresh route already stop retrying — no new contract for callers to learn. The distinct `code` is what makes it legible. A bare `null` would read as transient and retry forever. tokenHealthCheck marks the connection terminal with the reason Placed after the existing terminal-status guard, which makes it idempotent for free: once "expired", later sweeps skip the row, so it writes once instead of rewriting the same reason every cycle. the manual-refresh route stops lying It said "Refresh token expired. Please re-authenticate this account." — false here: the token is fine, the provider is gone. Re-authenticating would loop against something that no longer exists. It now reports the deprecation and the migration target. `gemini` uses the same OAuth client, so re-adding the account there is a working path, not advice to start over. Deliberately NOT touched: Category A — the gemini-cli CLIENT identity (diegosouzapw#7034): clientIdentityProfiles.ts, clientApi.ts, googApiKeyAuth.ts. Same string, opposite direction — requests ARRIVING from the Gemini CLI, where OmniRoute is the server. Deleting these is the failure this change must never cause, so a test now asserts the profile survives. Audited: `git diff --name-only` touches none of those files. errorClassifier.ts's isCloudCodeProvider list still names gemini-cli. It is a defensive 403→PROJECT_ROUTE_ERROR list shared with cloudcode/cloud-code; the entry is unreachable for a non-routable provider, and editing a shared classification path for a dead string is risk without upside. Tests — 42 across the six files that mention the identifier, all green: gemini-cli-legacy-refresh.test.ts 5 (3 assertions REWRITTEN, see below) gemini-cli-deprecation.test.ts 5 (new) client-identity-profiles.test.ts 9 (category A, untouched) service-token-refresh.test.ts 14 errorclassifier-antigravity-403.test.ts 4 gemini-cli-ansi-sanitization.test.ts 5 (category C, untouched) The three rewritten assertions in the legacy file are alignment, not weakening, and the gate is right to ask: each is now STRONGER. "refresh succeeds against Google's token endpoint" became "zero upstream calls happen at all"; "a 400 surfaces invalid_grant" became "the envelope is unchanged but the code says provider_deprecated" plus a control asserting `gemini` still reports invalid_grant, proving the real path was not blunted. The file's header keeps the whole diegosouzapw#8232 → diegosouzapw#8275 → deprecation arc, because each step is why the next made sense. Count unchanged; no test deleted, so no allowlist entry needed. * docs(changelog): fragment for diegosouzapw#8980 --------- Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
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
gemini-cliconnectionsgemini-clifrom the public provider registry, OAuth provider UI, Antigravity model catalog, passthrough routing, and provider snapshotWhy
#8232 correctly targeted a real compatibility bug: legacy
gemini-cliconnections with valid refresh tokens were skipped by the proactive health checker and eventually required re-authentication.However, it exceeded that narrow goal by recreating
gemini-clias a complete canonical, routable, and UI-visible provider backed by the Antigravity model catalog. This PR corrects that unnecessary reimplementation without regressing the OAuth refresh behavior that #8232 intended to restore.The resulting boundary is explicit:
REGISTRY["gemini-cli"],OAUTH_PROVIDERS["gemini-cli"], and the provider translation snapshot remain absent.supportsTokenRefresh("gemini-cli")remains true for legacy database rows.PROVIDERS.geminiOAuth credentials rather than requiring a standalone provider entry.Validation
npm run typecheck:corenpm run check:provider-consistencynpm run check:docs-allstill reaches the pre-existing environment-documentation drift forGROK_AUTH_PATHandOMNIROUTE_VNC_CONTAINER_VNC_PORT; provider-count synchronization passes.