Commit Graph

166 Commits

Author SHA1 Message Date
xmllist
2bec2e1801 Update Antigravity provider config and headers
- Simplify ANTIGRAVITY_HEADERS to dynamic User-Agent only
- Use IDE_TYPE, PLUGIN_TYPE enums and getPlatformEnum() in metadata
- Update antigravity baseUrl to sandbox endpoint
- Bump User-Agent version from 1.104.0 to 1.107.0
- Remove redundant header spread in AntigravityExecutor

Made-with: Cursor
2026-03-17 10:12:17 +07:00
decolua
f264bb9a23 Refactor error logging to provide clearer context on provider failures 2026-03-14 17:08:11 +07:00
decolua
877eea8ebe chore: Update package version to 0.3.51 and improve connection handling in API route 2026-03-14 11:56:29 +07:00
decolua
6b624af4d0 fix: Update abort method in pipeWithDisconnect to return a promise for better error handling 2026-03-14 11:38:33 +07:00
Quan
39f651f5be feat: Add Google Cloud Vertex AI provider support (vertex, vertex-partner)
Co-authored-by: Quan <quanle96@outlook.com>
PR: https://github.com/decolua/9router/pull/298

Thanks to @kwanLeeFrmVi for the original implementation. Here is a summary
of changes made during review integration:

- Replaced google-auth-library with jose (already a project dependency)
  for SA JSON -> OAuth2 Bearer token minting (RS256 JWT assertion flow)
- Moved auth logic (parseSaJson, refreshVertexToken, token cache) from
  executor into open-sse/services/tokenRefresh.js to match project pattern
- Fixed executor to use proxyAwareFetch instead of raw fetch (proxy support)
- Simplified buildUrl: use global aiplatform.googleapis.com endpoint for
  both vertex (Gemini) and vertex-partner; removed region/modelFamily fields
- Added auto-detection of GCP project_id from raw API key via probe request
  (vertex-partner only, cached per key)
- Added vertex/vertex-partner cases to /api/providers/validate/route.js
- Updated model lists based on live testing:
  - vertex: gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview,
    gemini-3-flash-preview, gemini-2.5-flash (removed gemini-2.5-pro: 404)
  - vertex-partner: deepseek-v3.2, qwen3-next-80b (instruct+thinking),
    glm-5 (removed Mistral/Llama: not enabled in test project)
  - gemini provider: added gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview
- Removed bun.lock (project uses npm/package-lock.json)
- Removed region and modelFamily UI fields (global endpoint, auto-detect)
- Kiro token auto-refresh on AccessDeniedException (from commit 2)

Made-with: Cursor
2026-03-14 11:37:23 +07:00
decolua
adae2605bf Feat : Auto restart after crash 2026-03-14 09:37:29 +07:00
decolua
549223c8cf Fix codex image 2026-03-13 14:47:40 +07:00
decolua
399adca63d feat: Add support for local Ollama Local provider 2026-03-13 10:22:59 +07:00
Nick Roth
754a24d52a fix: SSE data: [DONE] sentinel + response_format for Claude via GitHub
- Guard data: [DONE] in github.js TransformStream with stream === true
- Inject response_format as system prompt for Claude models via GitHub executor

Note: stream.js guards skipped, createSSEStream is only called for true streaming paths.

Cherry-picked and adapted from PR #286 by @rothnic
https://github.com/decolua/9router/pull/286

Made-with: Cursor
2026-03-13 10:13:02 +07:00
Nick Roth
d12b14f411 feat: AI SDK compatibility - Accept header & JSON markdown stripping
- Respect Accept: application/json header to return non-streaming JSON
  instead of SSE, fixing AI SDK generateObject/generateText compatibility
- Strip markdown code block markers (```json...```) from Claude
  non-streaming responses to prevent JSON parse errors

Cherry-picked and adapted from PR #290 by @rothnic
https://github.com/decolua/9router/pull/290

Made-with: Cursor
2026-03-13 10:00:47 +07:00
decolua
373b10ebb5 feat(chat): Enhance bypass handling and introduce CC filter naming feature
Fix : Ollam Provider response
2026-03-13 09:41:40 +07:00
Nick Roth
75270ea755 feat: Add OpenAI API response_format support for structured JSON output
Translates OpenAI response_format parameter into Claude-compatible system
prompt instructions, enabling structured JSON output for json_schema and
json_object types.

Co-authored-by: Nick Roth <nlr06886@gmail.com>
Made-with: Cursor
2026-03-12 16:30:47 +07:00
decolua
b0c6b61398 Refactor config 2026-03-12 16:20:46 +07:00
decolua
8223c87988 feat(memory-management): Introduce MEMORY_CONFIG for session and DNS management, including session TTL, cleanup intervals, and proxy dispatcher limits. 2026-03-12 15:57:21 +07:00
decolua
83d94daa82 feat(ollama): Enhance Ollama support by adding new models, updating API format handling, and integrating translation functionality. 2026-03-12 15:24:10 +07:00
decolua
32e3980a13 feat(ollama): Add Ollama provider support with models and configuration, including API endpoints and UI updates. 2026-03-12 15:24:02 +07:00
decolua
a224f68e5c feat(kimi-coding): Added Kimi Coding to the list of supported OAuth providers with specific configuration. 2026-03-12 10:48:11 +07:00
decolua
f1bf027c68 feat(usage): claude quota tracker 2026-03-12 09:42:17 +07:00
decolua
fe49b61dfb feat: - Introduced per-provider strategy overrides in settings, allowing for more flexible connection management.
- Added new provider models: DeepSeek 3.1, DeepSeek 3.2, and Qwen3 Coder Next.
- Implemented UI changes to support round-robin strategy with sticky limits in the provider detail page.
- Improved logging to display connection names instead of IDs for better clarity.
2026-03-11 18:04:38 +07:00
decolua
d9dad5bcf3 Fix : Add custom to model selector 2026-03-11 11:59:07 +07:00
Peter Steinberger
31775393e6 feat(iflow): sync model list with CLIProxyAPI
Made-with: Cursor
2026-03-10 16:38:32 +07:00
Peter Steinberger
06a5307160 feat(gemini-cli): add proper User-Agent and X-Goog-Api-Client headers
Match native GeminiCLI client fingerprint to avoid upstream rejection.
Also fix base executor to call transformRequest before buildHeaders so
subclasses can store model context for header generation.

Made-with: Cursor
2026-03-10 16:38:32 +07:00
luongquocloc8668@gmail.com
36f8a8ce16 feat(base): add 429 retry with fixed delay for all providers
Retry up to 2 times with 2s delay before falling back to next URL.

Made-with: Cursor
2026-03-09 17:36:16 +07:00
Xmllist
6437a1c55f refactor(claude-to-openai): simplify usage token calculation and final chunk assembly
Made-with: Cursor
2026-03-09 17:18:49 +07:00
apeltekci
30e4689fb9 fix(cline): refresh static model catalog
Made-with: Cursor
2026-03-09 16:21:53 +07:00
apeltekci
29f3e1894e fix(cline): use workos auth token shape
Made-with: Cursor
2026-03-09 16:21:29 +07:00
decolua
880f4eca91 feat(proxy): add proxy pool and per-connection binding + strictProxy support
- Centralize proxy management with reusable proxy pools
- Per-connection proxy binding with legacy fallback
- Add strictProxy option: fail hard instead of silently falling back to direct
- Resolve alicode-intl conflict: keep alicode-intl support + proxy support

Made-with: Cursor
2026-03-09 15:46:06 +07:00
decolua
758224749d Feat : Add support for the new "alicode-intl" provider 2026-03-07 10:08:55 +07:00
decolua
d347de8092 feat: enhance translator functionality and UI 2026-03-06 16:26:33 +07:00
decolua
75f486b7a2 Added profile ARN handling in OAuth provider mapping and improved polling logic in OAuth modal for better user experience. 2026-03-06 00:21:27 +07:00
decolua
573b0f0241 - Refines the overall structure of the CLI tools and MITM server functionalities.
- Add buildQwenBaseUrl function to construct URLs for Qwen resources.
- Update buildProviderUrl to support Qwen model requests.
- Enhance token refresh logic to include provider-specific data for Qwen.
- Refactor CLI Tools page to exclude MITM tools and streamline model retrieval.
- Introduce new components for MITM server management.
- Update API routes to handle Qwen-specific resource URLs and improve error handling.
2026-03-05 11:25:03 +07:00
Rodrigo Rodrigues Costa
40a53fbd33 Fix: Codex image support - convert image_url to input_image format (#236)
Cursor sends images as Chat Completions format:
  { type: "image_url", image_url: { url: "data:...", detail: "auto" } }

But Codex Responses API requires:
  { type: "input_image", image_url: "data:..." }

- openai-responses.js: bidirectional conversion image_url <-> input_image
- responsesApiHelper.js: input_image -> image_url in Responses->Chat path
- codex.js: safety net conversion in executor before sending to Codex API

Note: Cursor has a known bug where images bypass the Override OpenAI Base URL
and are sent directly to api.openai.com. This fix is effective for other clients
(curl, Codex CLI, Claude Code) that route through the proxy correctly.

Made-with: Cursor
2026-03-05 10:31:50 +07:00
decolua
11b2fcd643 Fix Antigravity OAuth 2026-03-03 16:01:10 +07:00
decolua
07d4cdfa7e Fix : Claude OAuth 2026-03-03 14:46:05 +07:00
decolua
4903a9b2cb Feat : console log 2026-03-02 09:31:16 +07:00
decolua
50990e84b4 Fix AG MITM 2026-03-01 18:40:55 +07:00
Владимир Акимов
7076108550 fix(translator): filter nameless hosted tools when converting Responses API to Chat format (#222)
Codex CLI sends "hosted" tools (e.g. `request_user_input`) via the OpenAI
Responses API. These tools have no explicit `name` field. The previous
`body.tools.map()` pass propagated `name: undefined` into the resulting
Chat Completions function declarations, which then became anonymous
`functionDeclarations` after the OpenAI→Gemini translation step.

Gemini strictly requires every function declaration to have a valid name
and rejects the entire request with:

  GenerateContentRequest.tools[0].function_declarations[4].name:
  Invalid function name. Must start with a letter or an underscore.

Fix: filter out any Responses API tool that lacks a non-empty `name`
string before converting to `{ type: "function", function: { name, ... } }`.
Named function tools are unaffected; only unnamed hosted tools are skipped.

Fixes: Gemini 400 error when Codex CLI is routed through 9router.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-01 08:48:43 +00:00
Cengizhan
f763d4ffed fix: resolve GitHub Copilot 400 error for Claude models in Cursor IDE (#220)
- github.js: add sanitizeMessages() to convert unsupported content types
  (tool_use, tool_result, thinking) to plain text before sending to
  GitHub /chat/completions endpoint
- openai-responses.js: skip pushing message blocks with empty content
  (e.g. assistant messages that only contain tool_calls)
- providerModels.js: revert targetFormat changes (not needed with sanitize fix)

Fixes: https://github.com/decolua/9router/issues/219
2026-03-01 15:38:14 +07:00
decolua
a7365c5a4e Fix : Codex on cursor 2026-03-01 15:35:41 +07:00
decolua
2f4b813c5b feat(usage): implement timeout and error handling for antigravity usage and subscription requests
- Add a 10-second timeout for fetch requests in getAntigravityUsage and getAntigravitySubscriptionInfo functions.
- Include error logging for fetch failures in both functions.
- Update headers to include "x-request-source" for MITM bypass.
- Enhance proxyFetch with DNS resolution and MITM bypass capabilities.
- Ensure proxyFetch is loaded in the API route for proper fetch patching.
2026-02-28 12:12:49 +07:00
decolua
04ba66bc1e chore: Refactor CursorAuthModal to handle manual instructions for Windows users. 2026-02-28 12:12:49 +07:00
gen
5a015e5b4d feat(proxy): add outbound HTTP proxy support for OAuth + provider requests
- Patch Node fetch via undici ProxyAgent when HTTP_PROXY/HTTPS_PROXY/ALL_PROXY is set
- Ensure proxy patch is loaded for both chat pipeline and OAuth token exchange
- Add Dashboard Settings → Network to edit outbound proxy and apply immediately
- Persist outbound proxy settings in local db and initialize on server startup
- Move proxy helpers to src/lib/network/ for better structure
- Rename src/proxy.js → src/dashboardGuard.js to avoid naming confusion
- Re-apply proxy env after DB import
- Fix: close old dispatcher on proxy URL change to prevent connection pool leak
- Fix: idempotency guard to avoid patching globalThis.fetch multiple times

Made-with: Cursor
2026-02-28 10:11:53 +07:00
decolua
833069caac Fix MITM on window 2026-02-28 10:04:57 +07:00
decolua
5954b8f4eb - Refactor chatCore.js to streamline imports and remove unused functions.
- Fix streaming /v1/responses
2026-02-27 11:15:12 +07:00
decolua
25c2ad7360 feat: implement model lock functionality for connection management 2026-02-27 10:29:11 +07:00
decolua
1f4423d444 Merge remote-tracking branch 'origin/master' 2026-02-27 09:35:39 +07:00
decolua
0e285a9ed3 Merge branch 'pr-203' 2026-02-27 09:33:14 +07:00
decolua
9ae5487bc7 Fix antigravity 2026-02-27 09:17:49 +07:00
司徒玟琅
4527e5e126 feat: update provider models(Cursor IDE) with new versions (#204)
- Added new provider models: Claude 4.6 Opus Max, Claude 4.6 Sonnet Medium Thinking, Kimi K2.5, Gemini 3.1 Pro Preview, Gemini 3 Flash Preview, GPT 5.2, and GPT 5.3 Codex.
2026-02-27 09:09:20 +07:00
BiuBiu_Hu
d14c18f77f refactor: rename provider to alicode (Aliyun Coding)
Rename alicloud to alicode to clearly indicate Aliyun's Coding Plan service.

- Provider ID: alicode (short for Aliyun Coding)
- Model format: alicode/qwen3.5-plus
- Simplified mapping - no more bidirectional aliases

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 08:05:05 +08:00