feat(providers): add openai-chatgpt provider (ChatGPT subscription via OAuth device-code) - #128
Merged
Merged
Conversation
…a OAuth) Wires the official provider-openai-chatgpt module into amplifier-agent's provider catalog. Adds openai-chatgpt as a selectable provider that authenticates via OAuth device-code flow to ChatGPT's backend API, enabling use of Plus/Pro/Team/Enterprise subscriptions without per-token billing. Changes: - loader.py: added openai-chatgpt to _VALID_PROVIDER_MODULES - provider_sources.py: added to KNOWN_PROVIDERS, PROVIDER_CATALOG, and new resolve_credential_detailed branch that checks for OAuth token cache at ~/.amplifier/openai-chatgpt-oauth.json (no api-key env var needed) - auth.py: added openai-chatgpt to _CONFIG_CREDENTIAL_UNSUPPORTED to prevent 'auth set' (device-code flow is the only auth method, like github-copilot) - bundle.md: declared provider-openai-chatgpt in install-only stub list Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Comprehensive documentation across all spec and integration layers for the new openai-chatgpt provider. Updates: - README.md: added to provider matrix - CHANGELOG.md: release note entry - docs/CONFIGURATION.md: configuration and credential handling (device-code OAuth) - docs/spec/providers-and-models.md: provider overview, models, auth flow - docs/spec/host-config.md: host config schema and examples - docs/spec/bundle-and-cache.md: cache behavior for OAuth tokens - docs/spec/cli.md: 'auth' command limitations for device-code flow - docs/LAYERS_AND_RELEASES.md: release metadata - docs/INTEGRATION.md: integration points and callbacks - docs/architecture/architecture.dot: updated provider catalog diagram - skills/amplifier-agent/SKILL.md: skill definition and capability index Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
This was referenced Aug 18, 2026
Salil Das (sadlilas)
pushed a commit
that referenced
this pull request
Aug 24, 2026
…li's tree Both raised by @DavidKoleczek on #142. 1. provider_sources.py read ~/.amplifier/openai-chatgpt-oauth.json directly. Pre-existing (PR #128), but this PR is what establishes the never-read-app-cli guarantee, and that was the read half. The provider accepts a token_file_path config key (provider.py:103), the same seam already used for anthropic's rate-limit file, so this is fixable rather than merely documentable. Includes a copy-forward so an existing login is not silently invalidated into a device-code prompt; copies, never moves. 2. bundle.md declared session_dir and base_path as literal YAML strings that nothing expands, so both ignored AMPLIFIER_AGENT_HOME. With it unset they equalled state_root() and the divergence was invisible -- including to every test either of us ran. Set it and the context-intelligence writer and reader split apart again, one level below where foundation_home fixed it. Now injected at runtime from state_root(), the same technique the vendored skills/modes dirs already use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
openai-chatgptas a first-class provider in amplifier-agent's provider catalog, wiring up the existing official moduleamplifier-module-provider-openai-chatgpt. It uses a ChatGPT Plus/Pro/Team subscription as the backend via OAuth device-code auth — distinct from the existingopenaiprovider (API key, public OpenAI API).Listed in the ecosystem
MODULES.mdbut not previously selectable from amplifier-agent, whose provider set is hardcoded (theISSUES.md"five literals" seam). This is a sibling to #127 (chat-completions); separate PR by design.What changed
Code
config/loader.py: addopenai-chatgptto_VALID_PROVIDER_MODULES.provider_sources.py: add toKNOWN_PROVIDERSandPROVIDER_CATALOG; add a dedicatedresolve_credential_detailedbranch that reports resolvable based on presence of the OAuth token cache (~/.amplifier/openai-chatgpt-oauth.json) — there is no api-key env var, since auth is device-code OAuth.admin/auth.py: addopenai-chatgptto_CONFIG_CREDENTIAL_UNSUPPORTED, soauth setis refused (as withgithub-copilot) — there is no static key to store.bundle.md: declareprovider-openai-chatgptin the install-only stub list.Docs: README,
docs/spec/*,docs/CONFIGURATION.md,docs/LAYERS_AND_RELEASES.md,docs/INTEGRATION.md,docs/architecture/architecture.dot,skills/amplifier-agent/SKILL.md,CHANGELOG.md.Dependency
A fully working device-code login also needs a one-line fix in the provider module: microsoft/amplifier-module-provider-openai-chatgpt#5 (its device-code poller aborted on the first poll before the user could authorize). This catalog wiring is independent of that fix, but an end-to-end login needs both.
Verification (Digital Twin, real ChatGPT subscription — no mocks)
Verified end-to-end in an isolated container running the patched build (
amplifier-agent 0.12.0), with module PR #5 applied, against a real ChatGPT account:providers list:openai-chatgptappears; reportsresolvable=false/source=nonewith no token, and flips toresolvable=true/source=fileafter the device-code login — exercises the catalog entry and the credential-resolution branch.provider.moduleis rejected with a valid set that now includesopenai-chatgpt.auth set openai-chatgpt: refused with OAuth-only guidance (likegithub-copilot).bundle.md; the prepared bundle declaresprovider-openai-chatgpt.amplifier-agent runreturned a correctgpt-5.5completion in ~4s (clean terminated envelope). Routing tochatgpt.com/backend-apiwas proven causally — blackholingchatgpt.commade the same turn fail withProviderUnavailableError, and restoring it made it succeed; no fallback is possible (config pinsopenai-chatgpt, all other providers unresolvable).