Skip to content

feat(subscription-ai): Community ChatGPT subscription-backed AI (gated) - #2371

Draft
HaijieChen wants to merge 5 commits into
OtterMind:mainfrom
HaijieChen:feature/subscription-backed-ai
Draft

feat(subscription-ai): Community ChatGPT subscription-backed AI (gated)#2371
HaijieChen wants to merge 5 commits into
OtterMind:mainfrom
HaijieChen:feature/subscription-backed-ai

Conversation

@HaijieChen

Copy link
Copy Markdown

Summary

  • Add Community subscription-backed ChatGPT AI behind packaging/runtime gates (CHAT2DB_PACKAGE_SUBSCRIPTION_AI / CHAT2DB_ENABLE_SUBSCRIPTION_AI), using a pinned Codex app-server path so Chat2DB never stores OAuth tokens.
  • Ship MCP tools/call end-to-end for DB tools, H2 subscription ledger, encrypted legacy API-key secret import (separately gated), and desktop packaging/staging scripts.
  • Frontend: subscription account + dual-zone model config (multi-vendor cards + full API-key CRUD), ready-to-use reasoning effort without opening the model dropdown, and live javaQuery desktop probe.

Commits (on top of main)

  • 00dd7cc fix(subscription-ai): make MCP tools/call work end-to-end on ChatGPT
  • e3e7e3c feat(subscription-ai): add Community subscription frontend UI
  • e6b4da5 feat(subscription-ai): add encrypted legacy API-key secret import
  • 0e10a4d feat(subscription-ai): ready-to-use effort control and dual-zone model config

Product / safety notes

  • Default-off until release gates and platform live-provider evidence pass.
  • SuperGrok subscription login is intentionally out of scope; xAI API-key configs remain available.
  • Do not reintroduce CodeMode/sol models for the first reliable DB-tools track; prefer function-capable models (e.g. gpt-5.5).

Test plan

  • Focused backend tests for MCP bridge, tool executor, subscription runtime, secret-import (tests explicitly enabled; nonzero Surefire counts)
  • Frontend lint / i18n / build:web:community
  • Package staging: bash -n script/package/stage-codex-app-server.sh + test-codex-app-server-staging.sh
  • Local Preview (gated ON): connect ChatGPT subscription → model list → ready-to-use effort control → chat send
  • Live DB tools path: list schema / execute_sql via MCP tools/call (no token leakage in logs)
  • Confirm secret-import remains separately gated and does not run by default
  • Confirm web/headless paths stay Community-safe and subscription surface stays desktop-gated

Source

Wire the subscription Codex app-server path so allowlisted DB tools reach
the loopback MCP bridge: answer serverRequests with correct shapes
(requestUserInput answers, permissions decision), allow MCP functionCall
namespace, keep CodeMode off, sandbox network for tools/call, and stop
text2sql from nested API-key chatSync fencing the attempt. Live gpt-5.5
verified list/schema/execute_sql tool_ok; text2sql delegated under tests.
Add subscription account panel, model selection groups, migration wizard,
attempt banners, and Zustand store with i18n for the ChatGPT-backed path.
Wire AI chat input/select and settings so Community can pick subscription
models without changing the existing API-key flow.
Introduce a gated, user-confirmed import path for encrypted API-key
configs: tools boundary + H2 ledger ports, JCEF query interceptor that
keeps secrets out of generic console logging, and importLegacy config
APIs that never silently overwrite an existing backend default.
…l config

Make subscription chat chrome usable without opening the model dropdown by
resolving reasoning efforts from option map, snapshots, and ChatGPT defaults,
and by rebuilding send-time model options when local map state lags. Redesign
the model config modal as a dual-zone page with multi-vendor cards (~2–3 per
row) plus full API-key CRUD, switch request routing to a live javaQuery probe,
and document packaging gates plus remaining CHG plans.
…UM findings

Harden MCP permission auto-approval to chat2db_subscription + allowlisted
tools, disable parallel tool advertising, drop CodeMode host from packaging
and CI staging, surface reauth/rate-limit turn failures, and bind secret-
import item ids to secret revisions. Preserve explicit API-key selection on
ready-to-use bootstrap, wire conversation-scoped model preferences, isolate
secret-import ledger startup failures, and close renderer gates for
default-off modal, migration entry, disabled options, late javaQuery, and
CONNECTING expiry cleanup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants