Skip to content

Admin UI for AI providers + ChatGPT sign-in#84

Merged
windoze95 merged 1 commit into
mainfrom
feature/ai-provider-settings
Jul 11, 2026
Merged

Admin UI for AI providers + ChatGPT sign-in#84
windoze95 merged 1 commit into
mainfrom
feature/ai-provider-settings

Conversation

@windoze95

Copy link
Copy Markdown
Owner

Summary

Adds an admin-only AI providers section to Settings (works on web too — same codebase) so the Discover AI configuration is managed from the app instead of only via server env vars. Pairs with backend #129 (runtime AI-config store) and #128 (ChatGPT sign-in).

  • Per-provider key cards (Anthropic / Gemini / OpenAI): obscured paste-to-set, a masked ••last4 · env/runtime badge showing whether the effective key comes from the app or the container env, and Clear (shown only for app-set keys) to revert to the env value. Keys are write-only — never read back from the server.
  • Embedding + ranking provider selection as chips (including Auto), each with a live "Using <provider> (<model>)" / "None available — add a key or sign in" readout.
  • ChatGPT subscription card: Connect kicks off the device sign-in, opens the verification page, shows the code to enter, and auto-polls every 3s until it flips to connected; Sign out clears it; surfaces the needs-reauth state.

Notes

  • New models are plain JSON classes (no freezed/codegen).
  • The section degrades gracefully (admin-gated; a failed load shows a message rather than throwing).

Test plan

  • New widget test covers the render-per-provider, masked-badge/effective-provider, and save-calls-setAiKey paths.
  • dart format clean, flutter analyze --fatal-infos --fatal-warnings clean, all 233 tests pass locally.

🤖 Generated with Claude Code

Adds an admin-only "AI providers" section to Settings (works on web — same
codebase) so the Discover AI config is managed in-app instead of only via
server env vars, backed by the new /api/settings/ai-providers +
/api/settings/chatgpt-login endpoints:

- Per-provider (Anthropic/Gemini/OpenAI) key cards: paste to set (obscured
  input), masked "••last4 · env/runtime" badge, Clear (only for runtime keys)
  to revert to the env value. Keys are write-only — never read back.
- Embedding + ranking provider selection as chips (incl. Auto), with a live
  "Using <provider> (<model>)" / "None available" readout.
- ChatGPT subscription card: Connect starts the device sign-in, opens the
  verification URL, shows the code, and auto-polls every 3s until connected;
  Sign out clears it; surfaces the needs-reauth state.
- lib/models/ai_providers.dart (plain JSON models, no codegen),
  api_service methods, endpoint constants, and a widget test covering the
  render/masking/save paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@windoze95
windoze95 merged commit 105f759 into main Jul 11, 2026
8 checks passed
@windoze95
windoze95 deleted the feature/ai-provider-settings branch July 11, 2026 17:24
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