Skip to content

fix(ai): refresh subscription models and harden OAuth flows - #2832

Merged
bobleer merged 2 commits into
GCWing:mainfrom
bobleer:bob/subscription-oauth-model-discovery
Sep 6, 2026
Merged

fix(ai): refresh subscription models and harden OAuth flows#2832
bobleer merged 2 commits into
GCWing:mainfrom
bobleer:bob/subscription-oauth-model-discovery

Conversation

@bobleer

@bobleer bobleer commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Subscription model discovery could show an outdated fixed Antigravity list, hide Codex subscription-only models, mix OpenCode offerings, and prevent retries after failures. Fetch account-scoped catalogs, add explicit refresh and failure states, and fix OAuth expiry, polling, and Nous authentication across the five subscription providers.

Type and Areas

Type: bug fix

Areas: AI adapters, subscription OAuth, Web UI model settings, documentation and locales.

Motivation / Impact

  • Antigravity uses authenticated fetchAvailableModels with endpoint fallback and preserves current server model IDs instead of returning a static seven-model list. An old display name alone does not imply an outdated model, and published models are not assumed to be available to every OAuth account.
  • Codex retains subscription-only entries marked supported_in_api: false, respects hidden entries, and reports catalog errors instead of silently using another CLI's local cache.
  • OpenCode refreshes offerings by Go/Zen plan and request format, clears obsolete optional catalogs, and propagates explicit refresh errors.
  • Codex and xAI respect the earliest JWT/stored expiry. OpenCode, xAI and Hermes share deadline-aware device polling with persistent slow_down backoff.
  • Nous Messages/model discovery uses Bearer authentication for its trusted HTTPS endpoint.
  • Model pickers support retry/refresh, discard stale responses after editor/device switches, and do not present preset subscription models as account-discovered results. Browser/peer Antigravity login reports the local desktop requirement.

Compared against OpenCode 7c2199d84a5830f70a8250731a42ff958145b4d6 and Hermes Agent 245e48008fa814b3251f50755eb656bd9fb86cb1.

Verification

  • cargo test -p openbitfun-ai-adapters --features subscription-auth --lib — 352 passed.
  • pnpm --dir src/web-ui exec vitest run src/infrastructure/config/components/modelDiscoveryCoordinator.test.ts src/infrastructure/config/components/subscriptionLoginCoordinator.test.ts src/infrastructure/config/components/ModelSettingsPage.presentation.test.ts — 16 passed across 3 files.
  • pnpm run fmt:rs, pnpm run check:core-boundaries, pnpm run i18n:audit — passed.
  • pnpm run check:web — passed (canvas, Appearance/theme governance, and TypeScript); generated API types with pnpm --dir src/web-ui run gen:types as build preparation.
  • pnpm run lint:web — passed with 0 errors (11 existing warnings). Effect cleanup captures its coordinator instance; the 16 focused frontend tests also pass after this correction.
  • git diff --check upstream/main...HEAD and node scripts/check-git-object-sizes.mjs --base upstream/main --head HEAD — passed after rebasing onto the latest upstream main.

Reviewer Notes

AI-assisted; testing level: lightly tested end to end, with focused automated regression coverage. Tests use local HTTP mocks and synthetic credentials; no live subscription login or inference was performed. Real SSH workspaces, remote control, Peer Device Mode and Detached Dispatch were not exercised. Surface-switch invalidation and device polling are covered locally. No desktop build or authenticated UI screenshots were produced.

Manual verification: rebuild the desktop app, sign into each provider, refresh the model picker, verify offerings against that account, and send a short request. Repeat discovery after a transient failure and after switching the active device. Existing saved model choices remain intact; no data migration or credential reset is required.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@bobleer
bobleer merged commit 8367b52 into GCWing:main Sep 6, 2026
14 checks passed
SWangHash pushed a commit to SWangHash/BitFun-OHOS that referenced this pull request Sep 8, 2026
)

* fix(ai): refresh subscription models and harden OAuth flows

* fix(web): capture model discovery coordinator for effect cleanup
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.

1 participant