Commit graph

32 commits

Author SHA1 Message Date
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
07d4cdfa7e Fix : Claude OAuth 2026-03-03 14:46:05 +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
833069caac Fix MITM on window 2026-02-28 10:04:57 +07:00
decolua
8221f7c027 Fix MITM 2026-02-23 21:56:40 +07:00
decolua
a5eb5a864e chore: add Gemini 3.1 Pro models to provider configurations 2026-02-22 15:20:24 +07:00
decolua
985985e454 refactor: update Antigravity model configurations and pricing 2026-02-20 17:52:15 +07:00
zx
a229d79158 feat(antigravity): initial steps for Antigravity anti-ban alignment
Cherry-picked from decolua/9router#141 (author: LinearSakana / zx <me@char.moe>)

- Implement client identity spoofing with numeric enums (ideType: 9, pluginType: 2)
- Add runtime platform detection for User-Agent and metadata
- Implement per-connection session ID caching (binary-compatible format)
- Add ANTIGRAVITY_HEADERS (X-Client-Name, X-Client-Version, x-goog-api-client)
- Add X-Machine-Session-Id header injection
- Align metadata/mode parameters across all Antigravity API calls
- Implement double injection for system prompt (raw + [ignore] wrapped)
- Rename internal anti-loop header to x-request-source for anonymity

Skipped: commit 6 (signature side-channel caching) — kept DEFAULT_THINKING_GEMINI_SIGNATURE
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-20 14:44:29 +07:00
apeltekci
ac7cedd27e feat(responses): respect client streaming preference + string input support (#121)
- Remove forced stream=true from responsesHandler
- Add stream-to-JSON converter for non-streaming clients (Codex)
- Accept string input in Responses API (normalize to array)
- Codex SSE header fallback for missing Content-Type
- Refactor: extract shared normalizeResponsesInput()

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 11:47:55 +07:00
decolua
d3c3a4ae0a Remove Docker publish workflow and update error handling in various modules
- Added handling for HTTP_STATUS.NOT_ACCEPTABLE in error types and messages.
- Enhanced the `prepareClaudeRequest` function to filter built-in tools for non-Anthropic providers and clean up empty tool arrays.
- Updated the `openaiToClaudeRequest` function to handle built-in tools more effectively and ensure proper tool conversion.
- Improved the `claudeToOpenAIResponse` function to skip processing for built-in server tool blocks.
- Refined error message handling in the `parseUpstreamError` function to ensure meaningful output.
- Adjusted command checks for tool installations across various settings routes to use `command -v` for better compatibility.
2026-02-10 19:18:40 +07:00
decolua
e7dfdc9274
Merge pull request #77 from Blade096/fix/openai_to_claude_missingthinking
feat(translator): add thinking parameter support in OpenAI → Claude
2026-02-08 16:47:24 +07:00
decolua
2e854bd4c9 feat(antigravity): integrate Antigravity tool with MITM support and update CLI tools 2026-02-08 16:28:13 +07:00
Blade096
54e01d617d feat(translator): add thinking parameter support in OpenAI → Claude
Preserve thinking configuration when converting OpenAI requests to Claude format.

- Handle thinking.type with 'enabled' as default

- Preserve thinking.budget_tokens when present

- Preserve thinking.max_tokens when present

This enables proper thinking mode support for o1-series models

when routed through 9Router to Claude endpoints.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
(cherry picked from commit 65d80e9269cc6789cb1522b276e8b8399fddbcab)
2026-02-07 21:45:50 +08:00
decolua
39c555ca7e docs: clarify Droid CLI compatibility comment in Responses API translator
Co-authored-by: Emanuel Covelli <emanuel.covelli@netserv.it>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 09:56:57 +07:00
decolua
3c65e0c5f2 feat: Improve Antigravity quota monitoring and fix Droid CLI compatibility 2026-02-05 22:15:26 +07:00
decolua
32aefe5a76 feat(executors): Improved UI components for displaying provider limits and usage statistics in the dashboard. 2026-02-05 18:38:50 +07:00
decolua
0a026c7af6 feat(cursor): Add cursor Provider 2026-02-05 11:06:20 +07:00
decolua
c7219d0ac9 Fix cloud 2026-01-29 18:07:28 +07:00
decolua
79342c0c3e ok 2026-01-27 10:49:16 +07:00
decolua
d3dd8686fe Fix Kiro 2026-01-23 17:36:23 +07:00
decolua
da15660681 Fix Kiro 2026-01-18 22:12:58 +07:00
decolua
2449d08885 ok 2026-01-18 18:54:52 +07:00
decolua
eff52f75ae Fix kiro 2026-01-16 12:11:32 +07:00
decolua
26b61e5fbb Feat Kiro OAuth, Fix Codex 2026-01-15 18:29:47 +07:00
decolua
ef49595866 Fix antigravity 2026-01-12 18:24:04 +07:00
decolua
509b68fb75 Fix Antigravity 2026-01-12 17:59:53 +07:00
decolua
fb5be37e14 Fix Antigravity 2026-01-12 16:53:27 +07:00
decolua
af5edfd00e Fix bug antigravity 2026-01-12 15:08:31 +07:00
decolua
f46ff42cb3 refactor: streamline provider interactions and enhance error handling 2026-01-11 21:45:01 +07:00
decolua
18533505ef refactor: restructure translator from from-openai/to-openai to request/response folders 2026-01-09 17:14:51 +07:00