31 Commits

Author SHA1 Message Date
Sutarto Jordan Chrisfivo
639f1204d0 fix(antigravity): retry transient upstream failures
Retry short-lived 5xx/capacity errors (500/502/503/504 + message
patterns) with bounded backoff capped at 15s; honor Retry-After/reset
hints and skip when wait is too long. Keep 400 non-retryable. Enable the
retry hook for 500 alongside existing 429/503.

Deduplicate sanitized Antigravity tool names before emitting the single
functionDeclarations group to avoid upstream "Tool names must be unique"
rejections.

Add Headroom size diagnostics and phantom-savings warning when reported
token delta does not shrink the outbound payload.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 17:19:46 +07:00
suryacagur
940a35e009 feat(blackbox): overhaul provider catalog + WebUI test support
- registry: baseUrl -> /v1/chat/completions, 10 latest models with
  upstreamModelId prefix, add thinkingConfig + serviceKinds
- capabilities: rename claude-opus-4.6 -> 4.8, bump claude-sonnet-4.6
  maxOutput 64k -> 128k
- testUtils: add blackbox case to testApiKeyConnection (GET /models)
- ollama: add minimax-m3 model

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 12:03:58 +07:00
Brokenc0de
49a3ec7a72 fix(capabilities): mark Claude Opus 4.7 (dashed id) as 1M context
Registry exposes the dashed id claude-opus-4-7; matchPattern treats "."
as a literal, so it missed the dotted pattern and fell through to the
generic claude opus entry (200k / claude-budget). Add an exact entry so
it resolves to 1M context + adaptive thinking, plus a unit test covering
the dashed Opus ids.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 11:40:28 +07:00
Brokenc0de
ab5ec52f28 feat(providers): add Venice AI provider
OpenAI-compatible apikey provider (chat/embedding/image) with dynamic
model discovery via modelsFetcher + passthroughModels. No executor needed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 11:37:44 +07:00
EdisonPVE
eb9728d084 fix(kiro): report 1M context window for claude-opus-4.8
Add 1M context capability overrides for claude-opus-4.8 and -thinking
variants, and use the resolved capability contextWindow (fallback 200k)
instead of the hardcoded 200k estimate in the Kiro executor.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 11:22:26 +07:00
nguyenha935
ce844899ed fix(tts): resolve Gemini TTS models from catalog
Resolve Gemini TTS models from shared TTS catalog and provider registry
with a safe fallback, fixing requests resolving to models/undefined when
ttsConfig.models is empty. Add gemini-3.1-flash-tts-preview to catalogs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 10:32:34 +07:00
decolua
d4ecad24d3 fix(antigravity): add kind:image to image models so they show in media-providers UI
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 17:59:51 +07:00
Nautilaceae
5306bd904e feat(antigravity): native image generation support
Add image generation for Antigravity provider via gemini-3.1-flash-image
and gemini-3-pro-image, exposed through Text to Image UI and
/v1/images/generations.

- registry: serviceKinds ['llm','image'] + image model entries
- executor: image model detection + image_gen request envelope
- chatCore: force stream=false for image models (generateContent)
- nonStreamingHandler: parse inlineData -> markdown image
- imageGenerationCore: useExecutor fast-path for executor delegation
- imageProviders/antigravity: image adapter with image input support
- usage/google: image models in quota whitelist

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 17:54:32 +07:00
swatker
b4d2754d32 fix: enable vision capability for MiniMax-M3
The pattern matcher marked *minimax-m3* as vision: false, causing
9Router to strip image attachments before forwarding upstream. This
broke Claude Code / Cursor / Cline vision flows when routing through
MiniMax-M3.

Scoped vision: true to *minimax-m3* only. M2.7 and the catch-all
*minimax* pattern remain vision: false: those models are text-only
(per MiniMax docs / NVIDIA NIM model card), so forcing vision there
would send images to a model that errors instead of degrading.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 17:50:08 +07:00
Janu Yoga
8321032e36 feat(codebuddy-cn): add API key auth + credit quota tracker
Two additions on top of the merged CodeBuddy CN OAuth provider:

1. API key auth — connect with a direct API key (sent as
   Authorization: Bearer), not only via OAuth device-code flow.
   - registry: add authModes ["oauth","apikey"] + hasOAuth; combined Bearer
     auth already forwards the key, token-refresh skips key connections.
   - providers POST: accept dual-auth providers (authModes includes
     "apikey") that live under category "oauth" — previously rejected as
     "Invalid provider". Also fixes the same latent gap for xai.

2. Quota tracker — surface CodeBuddy CN credit balance on the usage
   dashboard for both OAuth and API-key connections.
   - registry: add transport.usage.url (Tencent billing endpoint) +
     features.usage/usageApikey so the connection is quota-eligible.
   - new CN-scoped handler services/usage/codebuddy-cn.js: POST the billing
     meter endpoint, unwrap data.Response.Data.Accounts[]. The payload mixes
     two credit types that must not be merged:
       * refill/base ("基础体验包") — recurring allowance; cycle resets well
         before the resource expires (CycleEndTime << DeductionEndTime).
         Reads the *Cycle* balance, resetAt = next refresh. Cadence-labelled.
       * bonus ("活动赠送包") — one-shot credits that expire at CycleEndTime.
         Reads the plain Capacity balance. Labelled "Bonus Pack N".
     One quota row per package, soonest-expiring first.
   - register handler under "codebuddy-cn" in USAGE_HANDLERS.

Frontend needs no change — USAGE_SUPPORTED_PROVIDERS/USAGE_APIKEY_PROVIDERS
and the generic parseQuotaData branch already cover this shape.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 16:12:20 +07:00
Janu Yoga
791705ae7a feat(codebuddy-cn): add short model prefix alias "cbcn"
codebuddy-cn shipped without a short alias, making its model prefix the
longest of any provider (codebuddy-cn/glm-5.2). Add alias + uiAlias
"cbcn" so the prefix becomes cbcn/glm-5.2, consistent with qoder (qd),
kiro (kr), codex (cx). "cbcn" = CodeBuddy CN; reserves "cbai" for a
future codebuddy-ai (intl) provider.

Backward-compatible: full id codebuddy-cn/... still resolves (resolver
matches both id and alias).

Also regenerate tests/__baseline__/alias-baseline.json: idToAlias entry
codebuddy-cn now maps to cbcn, and cbcn joins the sorted modelKeys list.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 16:02:38 +07:00
nguyenha935
8efacc1147 feat(opencode-go): align Go models with official endpoints
Update OpenCode Go model catalog to match the official Go docs.
Route Qwen 3.7 and MiniMax models through /v1/messages with
Anthropic-compatible headers instead of OpenAI-compatible chat.
Keep GLM, Kimi, DeepSeek, and MiMo on /chat/completions; use
kimi-k2.7-code because the live Go API rejects kimi-k2.7 for chat
while the docs config example uses the code model ID.

PR #1931 by nguyenha935

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-20 15:09:11 +07:00
decolua
b55cf36d2e feat(headroom): add proxy lifecycle management + dashboard UI
Build on the optional Headroom Token Saver from Carmelo Campos
(PR: feat: add optional Headroom token saver). Add managed start/stop
of the local headroom proxy from the dashboard, install detection,
status probing, and a simplified Token Saver UI.

- detect headroom CLI + python>=3.10, probe proxy /health
- spawn/stop proxy as a detached, pid-tracked process
- /api/headroom/{status,start,stop} routes, gated local-only in dashboardGuard
- one-click Start/Stop Headroom modal, no manual config needed
- claude<->openai shape conversion for /v1/compress via 9router translators

Thanks to Carmelo Campos (@carmelogunsroses) for the original Headroom integration.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-20 10:09:50 +07:00
Janu Yoga
efd20be8d8 feat(provider): add CodeBuddy CN provider (copilot.tencent.com)
Add Tencent CodeBuddy CN (codebuddy-cn) OAuth provider with full support:
OAuth login (GET poll with state query param), token refresh, 15-model
catalog, /v2 inference endpoint, forced streaming, OpenAI-style reasoning,
and per-model capabilities. Renamed from codebuddy to codebuddy-cn to allow
a future codebuddy-ai variant.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 15:33:26 +07:00
decolua
7354c5e5f4 # v0.5.3 (2026-06-18)
## Fixes
- **Kiro**: honor thinking effort budgets
- **AG/Kiro/Xiaomi**: provider fixes
- **Combo/Fusion**: flatten tool history in panel calls to prevent 503
- **LLM selector**: show custom vision models in selector and model list
- **Image**: prevent compatible nodes from shadowing provider aliases
2026-06-18 17:36:08 +07:00
decolua
3f9382dee4 Fix AG, Kiro, Xiaomi Provider 2026-06-18 14:58:00 +07:00
Sutarto Jordan Chrisfivo
5e5e78d3e8 fix: show custom vision models in LLM selector and model list
Expose user-added imageToText custom models as vision-capable chat
models in the default LLM selector and /v1/models, map custom service
kinds to runtime capabilities, and keep typed filtering for
/v1/models/{kind}.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 09:13:27 +07:00
thienpv
706e6513c9 feat(kiro): headless API-key auth + direct Claude/Kiro route
Adds long-lived API-key (ksk_) authentication for Kiro/AWS CodeWhisperer
and a direct claude:kiro / kiro:claude translation route that avoids the
lossy OpenAI two-hop pivot.

- translator: claude-to-kiro request + kiro-to-claude response translators,
  registered on the exact source:target pair (direct route ahead of the
  OpenAI pivot in index.js). claude-to-kiro uses shared schema constants
  (ROLE/CLAUDE_BLOCK/DEFAULT_IMAGE_MIME) per app convention.
- auth: POST /api/oauth/kiro/api-key imports + validates a key via
  ListAvailableProfiles, persists authMethod="api_key" (no refresh token).
- executor: send tokentype: API_KEY header and try *.amazonaws.com hosts
  first for api-key creds; OAuth keeps kiro.dev first.
- fix: never inject the default placeholder profileArn for api-key auth
  (CodeWhisperer 403s an ARN not owned by the key's account).
- ui: API Key method in the Kiro connect modal; surface api-key accounts
  on the Quota Tracker and provider count.
- stream: env-overridable TTFT vs stall timeouts + Kiro keepalive frame.
- tests: claude-kiro-direct + kiro-profile-arn (11 tests).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 10:01:30 +07:00
decolua
d03f9fb823 Enhance configuration and model capabilities 2026-06-16 23:32:28 +07:00
decolua
b282f05549 Refactor 2026-06-15 18:18:04 +07:00
decolua
aba4c45da6 fix(translator): ESM-safe registry + tool-id pairing + responses max_tokens; add real-creds tests
- translator/index.js: replace require() with static side-effect imports (ESM-safe),
  lazy-init registry maps to survive circular import order
- openai-responses->openai: map max_output_tokens -> max_tokens (avoid leaking field upstream)
- gemini/antigravity -> openai: derive deterministic tool_call id from name so
  functionCall/functionResponse pair correctly (fixes provider tool-pairing 400s)
- add offline unit tests (finish-reason, usage, session-manager, ollama malformed args, const guard)
- add real-creds integration tests (provider-cases + all-formats matrix: 6 inbound formats x 4 scenarios)

Includes co-located provider registry refactor (pricing/capabilities/media providers) and sessionManager updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-15 11:38:43 +07:00
decolua
d3f61aac2f refactor(open-sse): translator DRY + schema enums, bug fixes, dead code cleanup
- Bug B1-B7: media UI m.kind||m.type, serviceKinds, gemini mediaPriority, schema kind, models/info lookup by kind
- Dead code D1-D6: safeParseJSON, drop PROVIDER_ENDPOINTS, orphan fetcher, GITHUB_CONFIG derive, getProviderConfig internal, legacy kiro file
- Translator concerns: toOpenAIUsage, toOpenAIFinish (gemini/kiro/ollama + fix kiro tool finish), thinking effort maps
- Reorg helpers/ → concerns/ (logic) + formats/ (per-format) + schema/ (pure enums: roles/blocks/finishReasons/defaults)
- Wire ~280 hardcoded role/block/finish/default literals to schema enums across 20+ files
- collapseTextParts + extractTextContent dedup
- Normalize translator fn names to openaiToXRequest / xToOpenAIResponse
- Golden tests lock behavior; 0 regression (byte-for-byte providers/alias, 26=26 known fails)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 18:49:38 +07:00
decolua
dd1e0f9bcc refactor(registry): B2 migrate to LiteLLM-style schema — unified models[] with kind field
- 71 registry files: flat `media.*Config.models` → `models[]` with `kind` field
- `media` wrapper removed → serviceKinds, *Config fields promoted top-level
- `type` field renamed to `kind` (llm/image/tts/stt/embedding/embedding/video/music)
- providers/index.js: PROVIDER_MEDIA now built from flat top-level media fields
- shared/constants/providers.js: buildProviderEntry reads flat top-level media fields
- route /v1/models: modelKind() uses kind||type; removed subConfig merge block
- models/info route: removed sub-config fallback lookup (all models in PROVIDER_MODELS)
- ttsProviders/index.js: synthesizeViaConfig reads tts models from PROVIDER_MODELS
- test-models route, helpers.js, validate route: kind||type compat
- Baselines: PROVIDERS 62/62 , Alias 90/90 

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 14:32:59 +07:00
decolua
e53ce79abb refactor(open-sse): B1 consolidate media endpoint URLs into registry
- image/embed/tts/search base URLs derive from media.*Config.baseUrl /
  searchViaChat.endpoint (single source); handlers read PROVIDER_MEDIA.
- ~18 hardcoded endpoints moved: bfl/fal/stability/runway/hf/gemini/
  cloudflare/recraft/sdwebui/comfyui/nanobanana image, voyage embed,
  gemini/openrouter tts, chatSearch endpoints.
- Byte-identical: PROVIDERS 62 + alias 90 baselines, image buildUrl outputs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 13:58:12 +07:00
decolua
bb9e9aa91f refactor(open-sse): registry consolidation + DRY media/oauth/adhoc cleanup
- Single-source registry: oauth clientId/tokenUrl, usage URLs, image/embed
  configs, search defaultModel, codex fixedPort, google token url derive.
- Remove 29 unused OmniRoute providers (registry 100→71); media intact.
- De-adhoc: codex literals → registry format/oauth flags; reasoningInject,
  image/embed openrouter headers + xai bodyFields config-driven.
- Add REGISTRY_TEMPLATE.js + expand PROVIDER_DEFAULTS/schema JSDoc.
- Baselines updated; PROVIDERS 62 + alias 90 byte-for-byte, golden snapshots.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 13:15:48 +07:00
decolua
4da1d6dad4 refactor(open-sse): D1c — forceStream hardcode → PROVIDERS schema (#5)
chatCore providerRequiresStreaming: switch provider-name →
PROVIDERS[provider].forceStream. Thêm forceStream:true vào registry
openai/codex/commandcode. verify-providers allowlist added-fields
(forceStream/urlSuffix verified bằng golden + runtime test riêng).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 22:05:01 +07:00
decolua
ad2a3e5de3 refactor(open-sse): D1a/D1b — URL quirks → schema urlSuffix + clean debug logs
buildUrl: switch provider-name → config-driven. ?beta=true thành
urlSuffix per registry (claude/glm/kimi/minimax/minimax-cn/kimi-coding);
gemini path dùng format==="gemini"; accountId substitution giữ generic.
Xóa console.log('[DEBUG]') trong refreshCline.
Golden url-header 142 pass (byte-for-byte URL).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 22:00:57 +07:00
decolua
72ce515709 refactor(open-sse): dedupe Google OAuth client credentials (#4)
clientId/clientSecret của antigravity + gemini bị lặp 3 nơi
(registry, usage.js, src/lib/oauth). Gom vào shared.js
(ANTIGRAVITY_OAUTH_CLIENT, GOOGLE_OAUTH_CLIENT), các file spread vào.
Byte-for-byte: PROVIDERS/alias/oauth-url equal, golden 142 pass.
Thêm test guard nội dung + alias resolution.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 21:53:14 +07:00
decolua
d2b0960bf7 refactor(open-sse): P3§7 model defaults schema — centralize type/quotaFamily/strip/targetFormat
- Add providers/models/schema.js (MODEL_DEFAULTS + field resolvers)
- Accessors getModelTargetFormat/QuotaFamily/Strip use shared default resolvers
- getModelType keeps null contract unchanged; behavior verified equal
- No catalog forced into registry (models stay self-contained per docs decision)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 21:13:37 +07:00
decolua
5a042840fd refactor(open-sse): P3 provider registry — split into providers/registry/{id}.js
- 100 registry files: transport + models co-located per provider (Mongoose-style)
- providers/shared.js: shared Claude headers + OS/arch helpers (deduped)
- providers/models/helpers.js: withCodexReviewModels (kept dynamic)
- providers/index.js builds PROVIDERS + PROVIDER_MODELS = old API (content byte-for-byte)
- config/providers.js + providerModels.js → barrel re-export, keep accessors + runtime helpers
- Verified: PROVIDERS/MODELS/OAuth/alias byte-for-byte, golden translator tests pass, 0 new regression

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 21:08:37 +07:00
decolua
34ea763d80 refactor(open-sse): add provider/model schema skeleton (C-prep)
New unwired modules providers/schema.js + models/schema.js with PROVIDER_DEFAULTS,
ENDPOINT_DEFAULTS, resolveProvider, MODEL_DEFAULTS, resolveModel (3-tier merge).
Foundation for upcoming registry tasks; no runtime wiring yet.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 17:05:42 +07:00