Files
openclaude/web
a5b277971d feat(settings): add settings-based subscription override and agy terminal support (#1731)
* feat(settings): add settings-based subscription override and agy terminal support

* feat(provider): rebrand Gemini wizard setup steps to Google AI / Gemini

* fix(settings): restrict subscription override to trusted sources

Addresses jatmn's CodeRabbit review on #1731.

P1 — untrusted settings sources could spoof subscriber state:
  Reads subscriptionType only from policy/flag/user/local settings,
  excluding project and repository settings which can be checked into
  shared repos. Adds getTrustedSubscriptionType() helper used by both
  isClaudeAISubscriber() and getSubscriptionType().

P2 — subscriptionType: "free" did not short-circuit OAuth-detected
  subscriber state. With a valid Claude AI OAuth token and
  subscriptionType: "free" in settings, isClaudeAISubscriber() still
  returned true. Now "free" is authoritative and returns false.

P3 — test isolation: added afterEach(mock.restore()) to auth.test.ts
  so Bun's module mocks cannot leak into subsequent tests.

Also splits the antigravity askpass test into focused cases for
"agy" and "antigravity" substrings.

* fix(settings): restrict subscriptionType override to user settings and return false early for free

* fix(auth): clean up unused import and return type matching in tests

* fix(provider): align Gemini chooser copy with the wizard's actual auth methods

Addresses jatmn's review on #1731. The /provider chooser advertised "Google AI /
Gemini Subscription" and "Use your Google AI Premium plan, …", but the Gemini
setup wizard only offers three auth methods — API key, access token, and local
ADC — with no subscription/Premium sign-in flow. Drop the "Subscription" label
and "Google AI Premium plan" framing so the chooser matches the wizard (and the
"Google AI / Gemini" wording used elsewhere in the file). No OAuth/subscription
sign-in is planned: using Google AI/Gemini subscriptions via third-party tools
violates Google's Terms of Service.

* fix(pr1731): resolve review follow-ups

* fix(pr1731): close review follow-ups

* fix(pr1731): close antigravity and gemini follow-ups

---------

Co-authored-by: jatmn <the@jat.mn>
2026-07-07 22:02:36 +08:00
..