| name | integrate-chatgpt-intelligence |
| description | Maintain Voice Layer's experimental opt-in ChatGPT route through its native PKCE OAuth and Responses client. Use when changing account login, model/effort policy, streaming, cancellation, tool calling, privacy, tests, or integration documentation. |
Integrate ChatGPT Intelligence
Boundary
Local llama-server inference is the default. ChatGPT is an explicit,
experimental subscription provider: it depends on upstream authentication,
account eligibility, and endpoint behavior, so it may break and is not
guaranteed. Do not turn it into an API-key route or a separately installed
command-line-client integration.
Source of truth
Read current source before changing this area:
src/settings.ts owns persisted selection, migration, and route snapshots;
src/chatgpt-models.ts and src/chatgpt-account.ts own ChatGPT-specific
model/account types; src/assistant-provider-settings.ts owns account UI,
disclosure, and provider transitions; src/main.ts composes the wiring.
src/assistant-ipc.ts, src/llm.ts, and src/assistant-coordinator.ts own
typed routing, correlation, replacement, and visible reply lifetimes.
src-tauri/src/chatgpt/ owns PKCE OAuth, app-owned credentials, the fixed
Luna policy, streaming Responses requests, tool execution, and cancellation.
docs/chatgpt-subscription.md, docs/model-integrations.md, PRIVACY.md,
and README.md are the public boundary. Keep them consistent with source.
Invariants
- Keep Local as the default and ChatGPT as explicit opt-in.
- Send the complete visible conversation only when ChatGPT is selected. Keep
microphone PCM, transcription, TTS, playback, credentials, and raw provider
payloads native/local.
- Use app-owned PKCE OAuth credentials stored in app data. Never accept API
keys or read an external tool's account state.
- Keep
gpt-5.6-luna as the only native subscription model and permit only
low, medium, and high reasoning efforts, defaulting to low. Do not silently
substitute another model or effort.
- Preserve
store: false, streaming Responses, visible-answer filtering,
request-scoped cancellation, and the shared AssistantCoordinator/
ReplySpeechTarget lifetimes.
- External API Tool Calling stays off by default. When enabled, expose only
the bounded native tool schemas selected in Settings and keep results within
the existing tool/privacy boundary.
Validation
Run focused tests first:
cargo test --manifest-path src-tauri/Cargo.toml chatgpt::
bun test tests/chatgpt-models.test.ts tests/settings.test.ts tests/llm.test.ts tests/assistant-coordinator.test.ts tests/live.test.ts
Then run just test, just check, and git diff --check as the change
requires. A real browser OAuth flow or response is an opt-in packaged-app
acceptance check, not evidence supplied by mocks or unit tests.