Commit Graph
70 Commits
Author SHA1 Message Date
FinessseandClaude Opus 4.5 221a386040 feat: sync with CLIProxyAPIPlus (excludes Amp, GitHub Copilot)
Synced all changes from router-for-me/CLIProxyAPIPlus including:

Executor updates:
- claude_executor: response decompression, beta extraction, model resolution
- gemini_executor/codex_executor: usage reporting
- antigravity_executor: fallback URLs, thinking metadata, token refresh
- kiro_executor: token refresh, profile ARN handling, quota fallback

Translator updates:
- Updated all translators for improved request/response handling
- Enhanced tool result formatting and streaming support

Configuration:
- Added IncognitoBrowser option for OAuth
- Updated KiroKey configuration
- Enhanced PayloadConfig options

SDK updates:
- Auth refresh registry improvements
- Cliproxy service enhancements
- Added ErrNotImplemented for executor interface

Excluded features (not synced):
- Amp CLI Integration module
- GitHub Copilot executor

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 02:10:20 +07:00
Finessse f83d2b638a chore: final legacy model purge and documentation update 2025-12-25 05:52:43 +07:00
Finessse 53918b4c92 feat(registry): upgrade model registry and thinking logic 2025-12-25 05:47:23 +07:00
Finessse d39b7b3e4f fix(droid): implement payload compaction for large droid histories 2025-12-25 05:44:57 +07:00
Luis Pater 8fee16aecd Merge PR #59: v6.6.50 (resolve conflicts) 2025-12-24 11:06:10 +08:00
hkfires e76ba0ede9 feat(logging): implement request ID tracking and propagation 2025-12-24 08:32:17 +08:00
Luis Pater e592a57458 Merge branch 'router-for-me:main' into main 2025-12-24 04:25:06 +08:00
Luis Pater f413feec61 refactor(handlers): streamline error and data channel handling in streaming logic
Improved consistency across OpenAI, Claude, and Gemini handlers by replacing initial `select` statement with a `for` loop for better readability and error-handling robustness.
2025-12-24 04:07:24 +08:00
gwizz 5bf89dd757 fix: keep streaming defaults legacy-safe 2025-12-23 00:53:18 +11:00
gwizz 4442574e53 fix: stop streaming loop on context cancel 2025-12-23 00:37:55 +11:00
gwizz 71a6dffbb6 fix: improve streaming bootstrap and forwarding 2025-12-22 23:34:23 +11:00
Luis Pater 5f65dd5bb4 Merge branch 'router-for-me:main' into main 2025-12-22 16:58:26 +08:00
moxi 830fd8eac2 Fix responses-format handling for chat completions 2025-12-22 13:54:02 +08:00
Finessse d44aadd1fc fix: address local UI guard and example executor 2025-12-20 06:03:11 +07:00
Finessse e76aacf5ec feat(executor): enhance Antigravity executor and handlers
- Add improvements to antigravity_executor.go for better CLI communication
- Update handlers.go with additional helper functions
2025-12-20 02:25:56 +07:00
Finessse 607abf2338 feat(sdk): update cliproxy auth and service modules 2025-12-19 18:18:48 +07:00
Finessse 15a2aa92ad models: add gemini-3-flash across providers 2025-12-18 19:31:20 +07:00
Finessse f022b151c2 openai: return JSON error envelopes 2025-12-18 16:49:45 +07:00
Finessse 626f501f49 droid: map custom: model ids to real model names 2025-12-18 16:32:08 +07:00
Finessse 358f7a6439 codex: synth SSE for huge/compaction responses with MAX_TOKENS retry 2025-12-18 14:18:28 +07:00
Finessse 99eb979353 models: add gemini-3-flash and gemini-3-pro-low (antigravity) 2025-12-18 14:17:57 +07:00
Finessse e2fe9f2403 auth: primary email override, trace headers, and cooldown reset 2025-12-18 01:43:07 +07:00
Finessse 72be557be8 middleware: keep tools for droid/factory 2025-12-17 20:34:06 +07:00
Finessse efb6965ef3 openai: treat Droid UA as agentic 2025-12-17 20:29:48 +07:00
Finessse e57cfdffb2 openai: inject default Factory tools 2025-12-17 20:29:17 +07:00
Finessse 944f70aedb factory: compact huge droid history + inject instructions 2025-12-17 20:14:01 +07:00
Finessse 1d2a9f6b5e factory: truncate oversized input_text 2025-12-17 20:01:56 +07:00
Finessse 1548b30abb openai: convert <tool_call> tags to function_call 2025-12-17 19:25:23 +07:00
Finessse d219b04b69 openai: enforce strict tool args 2025-12-17 19:18:06 +07:00
Finessse 0d6e1e6037 openai: stream errors to factory-cli as SSE 2025-12-17 17:37:51 +07:00
Finessse 52d5bd83f2 openai: return JSON error when streaming fails early 2025-12-17 17:06:49 +07:00
Finessse f9859ff6f3 fix(droid): strip non-JSON done sentinel from SSE 2025-12-17 14:19:23 +07:00
Finessse 7f260eb15e feat(openai): add embeddings + base-url aliases 2025-12-17 14:18:38 +07:00
Luis Pater 344066fd11 refactor(api): remove unused OpenAI compatibility provider logic
Simplify handler logic by removing OpenAI compatibility provider management, including related mutex handling and configuration updates.
2025-12-17 02:58:14 +08:00
Luis Pater 1efade8bdb Merge branch 'main' into plus 2025-12-17 02:50:14 +08:00
Finessse 99e9ff1ad6 docs: Claude Code via local proxy
- Document Windows Claude Code settings for using CLIProxyAPI (base URL, auth token, default model mapping)
- Add Claude alias remapping for opus/sonnet/haiku to Gemini-backed models
- Improve auth unavailability reporting (429 cooldown vs 503 blocked) and fallback provider inference
2025-12-17 00:33:25 +07:00
Luis Pater 670685139a fix(api): update route patterns to support wildcards for Gemini actions
Normalize action handling by accommodating wildcard patterns in route definitions for Gemini endpoints. Adjust `request.Action` parsing logic to correctly process routes with prefixed actions.
2025-12-17 01:17:02 +08:00
Luis Pater 52b6306388 feat(config): add support for model prefixes and prefix normalization
Refactor model management to include an optional `prefix` field for model credentials, enabling better namespace handling. Update affected configuration files, APIs, and handlers to support prefix normalization and routing. Remove unused OpenAI compatibility provider logic to simplify processing.
2025-12-17 01:07:26 +08:00
Finessse 4303412761 Fix synthetic /v1/responses SSE for tool calls 2025-12-16 13:23:47 +07:00
Finessse d0da29f954 Fix /v1/responses streaming for Factory Droid 2025-12-16 13:00:22 +07:00
Luis Pater 59ac1a3f60 Merge branch 'main' into plus 2025-12-15 23:53:23 +08:00
hkfires 3bc489254b fix(api): prevent double logging for error responses
The WriteErrorResponse function now caches the error response body in the gin context.

The deferred request logger checks for this cached response. If an error response is found, it bypasses the standard response logging. This prevents scenarios where an error is logged twice or an empty payload log overwrites the original, more detailed error log.
2025-12-15 16:36:01 +08:00
hkfires 4c07ea41c3 feat(api): return structured JSON error responses
The API error handling is updated to return a structured JSON payload
instead of a plain text message. This provides more context and allows
clients to programmatically handle different error types.

The new error response has the following structure:
{
  "error": {
    "message": "...",
    "type": "..."
  }
}

The `type` field is determined by the HTTP status code, such as
`authentication_error`, `rate_limit_error`, or `server_error`.

If the underlying error message from an upstream service is already a
valid JSON string, it will be preserved and returned directly.

BREAKING CHANGE: API error responses are now in a structured JSON
format instead of plain text. Clients expecting plain text error
messages will need to be updated to parse the new JSON body.
2025-12-15 16:19:52 +08:00
Finessse 4b4cd108ce Fix tool result ordering for Droid CLI 2025-12-14 23:34:54 +07:00
Luis Pater 79033aee34 Merge branch 'main' into plus 2025-12-14 00:07:46 +08:00
Ravens2121 db80b20bc2 feat(kiro): enhance thinking support and fix truncation issues
- **Thinking Support**:
    - Enabled thinking support for all Kiro Claude models, including Haiku 4.5 and agentic variants.
    - Updated `model_definitions.go` with thinking configuration (Min: 1024, Max: 32000, ZeroAllowed: true).
    - Fixed `extended_thinking` field names in `model_registry.go` (from `min_budget`/`max_budget` to `min`/`max`) to comply with Claude API specs, enabling thinking control in clients like Claude Code.

- **Kiro Executor Fixes**:
    - Fixed `budget_tokens` handling: explicitly disable thinking when budget is 0 or negative.
    - Removed aggressive duplicate content filtering logic that caused truncation/data loss.
    - Enhanced thinking tag parsing with `extractThinkingFromContent` to correctly handle interleaved thinking/text blocks.
    - Added EOF handling to flush pending thinking tag characters, preventing data loss at stream end.

- **Performance**:
    - Optimized Claude stream handler (v6.2) with reduced buffer size (4KB) and faster flush interval (50ms) to minimize latency and prevent timeouts.
2025-12-13 03:57:13 +08:00
teevercandgemini-code-assist[bot] 5ab3032335 Update sdk/api/handlers/claude/code_handlers.go
thank you gemini

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-12-12 00:26:01 -08:00
teevercandAmp 1215c635a0 fix: flush Claude SSE chunks immediately to match OpenAI behavior
- Write each SSE chunk directly to c.Writer and flush immediately
- Remove buffered writer and ticker-based flushing that caused delayed output
- Add 500ms timeout case for consistency with OpenAI/Gemini handlers
- Clean up unused bufio import

This fixes the 'not streaming' issue where small responses were held
in the buffer until timeout/threshold was reached.

Amp-Thread-ID: https://ampcode.com/threads/T-019b1186-164e-740c-96ab-856f64ee6bee
Co-authored-by: Amp <amp@ampcode.com>
2025-12-12 00:14:19 -08:00
Luis Pater 35fdd7bc05 Merge branch 'router-for-me:main' into main 2025-12-12 08:54:36 +08:00
Luis Pater 6e2306a5f2 refactor(handlers): improve request logging and payload handling 2025-12-12 08:52:52 +08:00