feat(subscription-ai): Community ChatGPT subscription-backed AI (gated) - #2371
feat(subscription-ai): Community ChatGPT subscription-backed AI (gated)#2371HaijieChen wants to merge 5 commits into
Conversation
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.
|
Thank you @HaijieChen for the substantial work behind this pull request. This PR provides valuable evidence that the product direction is technically achievable: Chat2DB Community can supervise a Codex app-server, use supported ChatGPT/Codex subscription access, discover models, stream turns, and connect Codex with Chat2DB database capabilities. The authentication, packaging, tool-safety, and recovery exploration is especially useful. We agree that this is a worthwhile feature. After reviewing the full change, however, we believe the technical solution needs an end-to-end redesign before merge rather than another round of incremental fixes inside the current structure. The open questions include the product/provider model, Agent Runtime ownership, chat routing, model-configuration source of truth, app-server lifecycle, durable state and H2 scope, database-tool permissions, and whether legacy API-key migration belongs in this feature. To separate the confirmed product goal from the unresolved architecture, we created:
Please use #2412 for design alternatives, diagrams, state machines, evidence from this implementation, and tradeoff discussion. We will also provide our own design proposal there after the problem and decision points are fully framed. For now, we will treat #2371 as an important feasibility implementation and source of test evidence, not as the final architecture. This design reset is not a dismissal of the work already done; it is intended to preserve the useful findings while giving the feature a smaller, clearer, and maintainable production boundary. Thank you again for taking this direction far enough that the project can now discuss it with concrete evidence. |
Summary
CHAT2DB_PACKAGE_SUBSCRIPTION_AI/CHAT2DB_ENABLE_SUBSCRIPTION_AI), using a pinned Codex app-server path so Chat2DB never stores OAuth tokens.javaQuerydesktop probe.Commits (on top of main)
00dd7ccfix(subscription-ai): make MCP tools/call work end-to-end on ChatGPTe3e7e3cfeat(subscription-ai): add Community subscription frontend UIe6b4da5feat(subscription-ai): add encrypted legacy API-key secret import0e10a4dfeat(subscription-ai): ready-to-use effort control and dual-zone model configProduct / safety notes
Test plan
build:web:communitybash -n script/package/stage-codex-app-server.sh+test-codex-app-server-staging.shtools/call(no token leakage in logs)Source
feature/subscription-backed-ai@0e10a4d