Skip to content

Commit 0efaeb7

Browse files
lidge-junclaude
andcommitted
feat(providers): protocol-based import criterion — add Kilo, Copilot, GitLab Duo, CF Gateway
Corrects the earlier import: the inclusion rule is PROTOCOL ("does it speak a standard streaming API opencodex can proxy"), not "is it an agent like Cursor". Adds the 4 standard-wire providers that rule was wrongly dropping: - kilo (openai-chat) — 443 models, single OpenAI-compatible endpoint - cloudflare-ai-gateway (anthropic) — template URL (account/gateway) - github-copilot, gitlab-duo (openai-chat) — multi-model gateways mapped to their universal OpenAI-compatible endpoint (audit caught that they span 3 protocols on one host; the anthropic-only mapping would have mis-routed their GPT/Gemini models). Verified with a deterministic coverage check against jawcode's registry: all 39 standard-wire providers represented, 0 missing, 0 proprietary leaked in. The 6 excluded are exactly the proprietary-protocol ones with no opencodex adapter: amazon-bedrock, cursor, google-antigravity, google-gemini-cli, google-vertex, openai-codex. Catalog: 26 -> 30. tsc clean. Plan + audit in devlog/61_provider-import/. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7a36f28 commit 0efaeb7

3 files changed

Lines changed: 78 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Plan — fix provider import criterion + verify full jawcode coverage
2+
3+
## Correction
4+
The earlier import used the WRONG exclusion criterion ("CLI-agent like cursor"). The correct rule is
5+
**protocol**: include any provider jawcode exposes on a standard streaming API opencodex already speaks
6+
(`openai-completions`→openai-chat, `anthropic-messages`→anthropic, `openai-responses`, `azure-openai-responses`,
7+
`google-generative-ai`); exclude only providers on a proprietary / non-HTTP-streaming protocol opencodex
8+
has no adapter for.
9+
10+
## Classification (derived from jawcode models.json `api` field)
11+
- **Include (39, standard wire):** alibaba, anthropic, azure-openai, cerebras, **cloudflare-ai-gateway**,
12+
deepseek, firepass, fireworks, **github-copilot**, **gitlab-duo**, google, groq, huggingface, **kilo**,
13+
kimi-code, litellm, minimax(+cn/code), mistral, moonshot, nanogpt, nvidia, openai, opencode(+go/zen),
14+
openrouter, qianfan, qwen-portal, synthetic, together, venice, vercel-ai-gateway, xai, xiaomi, zai, zenmux.
15+
- **Exclude (6, proprietary — no opencodex adapter):** amazon-bedrock (`bedrock-converse-stream`),
16+
cursor (`cursor-agent`), google-antigravity + google-gemini-cli (`google-gemini-cli`),
17+
google-vertex (`google-vertex`), openai-codex (`openai-codex-responses` — the codex backend itself).
18+
(`ollama-cloud` is native `ollama-chat` in jawcode but opencodex routes it via the OpenAI `/v1` endpoint → already included.)
19+
20+
## Gap (vs current opencodex coverage)
21+
Already present in opencodex (KEY_LOGIN catalog / OAUTH / init+GUI presets): all of the 39 EXCEPT four.
22+
**ADD these 4 standard-wire providers to `src/oauth/key-providers.ts`:**
23+
24+
| id | opencodex adapter | baseUrl | notes |
25+
|----|-------------------|---------|-------|
26+
| `kilo` | openai-chat | `https://api.kilo.ai/api/gateway` | clean — all 443 models openai-completions |
27+
| `cloudflare-ai-gateway` | anthropic | `https://gateway.ai.cloudflare.com/v1/{account-id}/{gateway}/anthropic` | clean — all 37 anthropic-messages; URL is a template |
28+
| `github-copilot` | openai-chat | `https://api.githubcopilot.com` | **REVISED per audit** |
29+
| `gitlab-duo` | openai-chat | `https://cloud.gitlab.com/ai/v1/proxy/openai/v1` | **REVISED per audit** |
30+
31+
groq/openrouter are already usable via the init+GUI presets, so they need no catalog entry.
32+
33+
## Audit fix (A FAILED → corrected)
34+
The auditor proved `github-copilot` and `gitlab-duo` are NOT single-protocol — their models span
35+
anthropic-messages + openai-responses + openai-completions. Mapping them to one `anthropic` adapter
36+
would mis-route their GPT/Gemini models. **Fix:** map both to `openai-chat` against their universal
37+
**OpenAI-compatible endpoint** (copilot: all models share host `api.githubcopilot.com`; gitlab: the
38+
`/proxy/openai/v1` endpoint) — one wire that serves the whole lineup, no mis-routing.
39+
40+
## Auth caveat (documented, not hidden)
41+
`github-copilot` and `gitlab-duo` are subscription gateways: they authenticate with a Bearer
42+
subscription token (not a plain provider API key), and copilot additionally expects a client
43+
`User-Agent` header. They're imported because the streaming IS a standard OpenAI-compatible API; the
44+
user supplies their token (and, for copilot, may add a `User-Agent` via custom provider `headers`).
45+
`cloudflare-ai-gateway` needs the account/gateway ids filled into the URL.
46+
47+
## Verify (Check phase)
48+
A deterministic script maps EVERY jawcode provider → its api → expected include/exclude → and confirms
49+
it against opencodex's actual catalog+presets+oauth. Pass = every standard-wire provider represented,
50+
every proprietary one absent. Plus `tsc` clean.
51+
52+
## Files
53+
- MODIFY `src/oauth/key-providers.ts` — add the 4 entries.
54+
- (docs) MODIFY `docs-site/.../guides/providers.md` — mention the gateways/proxies + auth caveat.

docs-site/src/content/docs/guides/providers.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,25 @@ validates the key, and stores it. Notable entries:
7676
| Z.AI (GLM Coding) | `https://api.z.ai/api/coding/paas/v4` |
7777
| Qwen Portal | `https://portal.qwen.ai/v1` |
7878
| Xiaomi MiMo | `https://api.xiaomimimo.com/anthropic` |
79+
| Kilo | `https://api.kilo.ai/api/gateway` |
80+
| GitHub Copilot · GitLab Duo | `https://api.githubcopilot.com` · `https://cloud.gitlab.com/ai/v1/proxy/openai/v1` |
81+
| Cloudflare AI Gateway | `https://gateway.ai.cloudflare.com/v1/{account}/{gateway}/anthropic` |
7982
| …and more | opencode zen, Vercel AI Gateway, Venice, NanoGPT, Synthetic, Qianfan, Alibaba, Parallel, ZenMux, LiteLLM |
8083

8184
Most use the `openai-chat` adapter with a bearer key; a few that expose only an Anthropic-compatible
8285
endpoint (e.g. **Xiaomi MiMo**) use the `anthropic` adapter (`x-api-key`).
8386

87+
:::note[Gateways & subscription proxies]
88+
A provider is included whenever it speaks a standard streaming API opencodex can proxy
89+
(`openai-completions`, `anthropic-messages`, `openai-responses`, Azure, or Gemini) — **not** based on
90+
whether it's an "agent" product. Providers on a proprietary protocol with no opencodex adapter are
91+
excluded: Cursor, Gemini CLI / Antigravity, Vertex AI, Amazon Bedrock, and the Codex backend itself.
92+
**GitHub Copilot** and **GitLab Duo** are multi-model gateways mapped to their universal
93+
OpenAI-compatible endpoint; they authenticate with a Bearer **subscription token** (not a plain API
94+
key), and Copilot may need a `User-Agent` header set via the provider's `headers`. **Cloudflare AI
95+
Gateway** needs your account + gateway ids filled into the URL.
96+
:::
97+
8498
### Ollama Cloud
8599

86100
Ollama Cloud is a hosted (not local) Ollama, OpenAI-compatible at `https://ollama.com/v1` with a key

src/oauth/key-providers.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ export const KEY_LOGIN_PROVIDERS: Record<string, KeyLoginProvider> = {
7575
"vercel-ai-gateway": { label: "Vercel AI Gateway", baseUrl: "https://ai-gateway.vercel.sh/v1", adapter: "openai-chat", dashboardUrl: "https://vercel.com/dashboard" },
7676
// Xiaomi MiMo exposes an Anthropic-compatible endpoint → anthropic adapter (x-api-key).
7777
xiaomi: { label: "Xiaomi MiMo", baseUrl: "https://api.xiaomimimo.com/anthropic", adapter: "anthropic", dashboardUrl: "https://xiaomimimo.com", defaultModel: "mimo-v2.5-pro" },
78+
// ── Gateways / multi-model proxies (standard wire; subscription-token auth) ──────────────
79+
// kilo: single-protocol OpenAI-compatible gateway (443 models). Cloudflare AI Gateway: anthropic
80+
// wire, URL is a template (fill in your account + gateway). github-copilot & gitlab-duo are
81+
// multi-model gateways whose models span 3 protocols on ONE host — mapped to their universal
82+
// OpenAI-compatible endpoint (one wire serves the whole lineup). Both need a Bearer subscription
83+
// token (not a plain API key), and copilot may need a `User-Agent` header via custom provider config.
84+
kilo: { label: "Kilo", baseUrl: "https://api.kilo.ai/api/gateway", adapter: "openai-chat", dashboardUrl: "https://kilo.ai" },
85+
"cloudflare-ai-gateway": { label: "Cloudflare AI Gateway", baseUrl: "https://gateway.ai.cloudflare.com/v1/{account-id}/{gateway}/anthropic", adapter: "anthropic", dashboardUrl: "https://dash.cloudflare.com/?to=/:account/ai/ai-gateway" },
86+
"github-copilot": { label: "GitHub Copilot", baseUrl: "https://api.githubcopilot.com", adapter: "openai-chat", dashboardUrl: "https://github.com/settings/copilot" },
87+
"gitlab-duo": { label: "GitLab Duo", baseUrl: "https://cloud.gitlab.com/ai/v1/proxy/openai/v1", adapter: "openai-chat", dashboardUrl: "https://gitlab.com/-/user_settings/personal_access_tokens" },
7888
};
7989

8090
/**

0 commit comments

Comments
 (0)