y
086d8d0d0b
fix(kiro): prepend placeholder user message when conversation starts with assistant role
...
Kiro/AmazonQ API requires the conversation history to start with a user message.
Some clients (e.g., OpenClaw) send conversations starting with an assistant message,
which is valid for the native Claude API but causes 'Improperly formed request' (400)
on the Kiro endpoint.
This fix detects when the first message has role=assistant and prepends a minimal
placeholder user message ('.') to satisfy the Kiro API's message ordering requirement.
Upstream error: {"message":"Improperly formed request.","reason":null}
Verified: original request returns 400, fixed request returns 200.
2026-02-12 11:09:47 +08:00
Luis Pater
2334a2b174
Merge branch 'router-for-me:main' into main
v6.8.12-0
2026-02-11 21:09:34 +08:00
Luis Pater
bc61bf36b2
Merge pull request #214 from anilcancakir/fix/github-copilot-model-alias-suffix
...
fix(auth): strip model suffix in GitHub Copilot executor before upstream call
v6.8.11-1
2026-02-11 21:06:58 +08:00
Luis Pater
7726a44ca2
Merge pull request #212 from Skyuno/fix/orphaned-tool-results
...
fix(kiro): filter orphaned tool_results from compacted conversations
2026-02-11 21:06:20 +08:00
Luis Pater
dc55fb0ce3
Merge pull request #211 from Skyuno/fix/kiro-websearch
...
fix(kiro): fully implement Kiro web search tool via MCP integration
2026-02-11 21:05:21 +08:00
Luis Pater
a146c6c0aa
Merge pull request #1523 from xxddff/feature/removeUserField
...
fix(codex): remove unsupported 'user' field from /v1/responses payload
2026-02-11 20:38:16 +08:00
Luis Pater
4c133d3ea9
test(sdk/watcher): add tests for excluded models merging and priority parsing logic
...
- Added unit tests for combining OAuth excluded models across global and attribute-specific scopes.
- Implemented priority attribute parsing with support for different formats and trimming.
2026-02-11 20:35:13 +08:00
RGBadmin
dc279de443
refactor: reduce code duplication in extractExcludedModelsFromMetadata
2026-02-11 15:57:16 +08:00
RGBadmin
bf1634bda0
refactor: simplify per-account excluded_models merge in routing
2026-02-11 15:57:15 +08:00
RGBadmin
4cbcc835d1
feat: read per-account excluded_models at routing time
2026-02-11 15:21:19 +08:00
RGBadmin
b93026d83a
feat: merge per-account excluded_models with global config
2026-02-11 15:21:15 +08:00
RGBadmin
5ed2133ff9
feat: add per-account excluded_models and priority parsing
2026-02-11 15:21:12 +08:00
Luis Pater
e9dd44e623
Merge pull request #209 from Buywatermelon/feature/default-kiro-aliases
...
feat(config): add default Kiro model aliases for standard Claude model names
2026-02-11 15:09:00 +08:00
Luis Pater
cc8c4ffb5f
Merge branch 'router-for-me:main' into main
v6.8.11-0
2026-02-11 15:07:06 +08:00
Luis Pater
1510bfcb6f
fix(translator): improve content handling for system and user messages
...
- Added support for single and array-based `content` cases.
- Enhanced `system_instruction` structure population logic.
- Improved handling of user role assignment for string-based `content`.
2026-02-11 15:04:01 +08:00
Anilcan Cakir
bcd2208b51
fix(auth): strip model suffix in GitHub Copilot executor before upstream call
...
GitHub Copilot API rejects model names with suffixes (e.g. claude-opus-4.6(medium)).
The OAuthModelAlias resolution correctly maps aliases like 'opus(medium)' to
'claude-opus-4.6(medium)' preserving the suffix, but the executor must strip the
suffix before sending to the upstream API since Copilot only accepts bare model names.
Update normalizeModel in github_copilot_executor to strip suffixes using
thinking.ParseSuffix, matching the pattern used by other executors.
Also add test coverage for:
- OAuthModelAliasChannel github-copilot and kiro channel resolution
- Suffix preservation in alias resolution for github-copilot
- normalizeModel suffix stripping in github_copilot_executor
2026-02-10 23:34:19 +03:00
Skyuno
09b19f5c4e
fix(kiro): filter orphaned tool_results from compacted conversations
2026-02-11 00:23:05 +08:00
Skyuno
7b01ca0e2e
fix(kiro): implement web search MCP integration for streaming and non-streaming paths
...
Add complete web search functionality that routes pure web_search requests to the Kiro MCP endpoint instead of the normal GAR API.
Executor changes (kiro_executor.go):
- Add web_search detection in Execute() and ExecuteStream() entry points using HasWebSearchTool() to intercept pure web_search requests before normal processing
- Add 'kiro' format passthrough in buildKiroPayloadForFormat() for pre-built payloads used by callKiroRawAndBuffer()
- Implement handleWebSearchStream(): streaming search loop with MCP search -> InjectToolResultsClaude -> callKiroAndBuffer, supporting up to 5 search iterations with model-driven re-search
- Implement handleWebSearch(): non-streaming path that performs single MCP search, injects tool results, calls normal Execute path, and appends server_tool_use indicators to response
- Add helper methods: callKiroAndBuffer(), callKiroRawAndBuffer(), callKiroDirectStream(), sendFallbackText(), executeNonStreamFallback()
Web search core logic (kiro_websearch.go) [NEW]:
- Define MCP JSON-RPC 2.0 types (McpRequest, McpResponse, McpResult, McpContent, McpError)
- Define WebSearchResults/WebSearchResult structs for parsing MCP search results
- HasWebSearchTool(): detect pure web_search requests (single-tool array only)
- ContainsWebSearchTool(): detect web_search in mixed-tool arrays
- ExtractSearchQuery(): parse search query from Claude Code's tool_use message format
- CreateMcpRequest(): build MCP tools/call request with Kiro-compatible ID format
- InjectToolResultsClaude(): append assistant tool_use + user tool_result messages to Claude-format payload for GAR translation pipeline
- InjectToolResults(): modify Kiro-format payload directly with toolResults in currentMessage context
- InjectSearchIndicatorsInResponse(): prepend server_tool_use + web_search_tool_result content blocks to non-streaming response for Claude Code search count display
- ReplaceWebSearchToolDescription(): swap restrictive Kiro tool description with minimal re-search-friendly version
- StripWebSearchTool(): remove web_search from tools array
- FormatSearchContextPrompt() / FormatToolResultText(): format search results for injection
- SSE event generation: SseEvent type, GenerateWebSearchEvents() (11-event sequence), GenerateSearchIndicatorEvents() (server_tool_use + web_search_tool_result pairs)
- Stream analysis: AnalyzeBufferedStream() to detect stop_reason and web_search tool_use in buffered chunks, FilterChunksForClient() to strip tool_use blocks and adjust indices, AdjustSSEChunk() / AdjustStreamIndices() for content block index offset management
MCP API handler (kiro_websearch_handler.go) [NEW]:
- WebSearchHandler struct with MCP endpoint, HTTP client, auth token, fingerprint, and custom auth attributes
- FetchToolDescription(): sync.Once-guarded MCP tools/list call to cache web_search tool description
- GetWebSearchDescription(): thread-safe cached description retrieval
- CallMcpAPI(): MCP API caller with retry logic (exponential backoff, retryable on 502/503/504), AWS-aligned headers via setMcpHeaders()
- ParseSearchResults(): extract WebSearchResults from MCP JSON-RPC response
- setMcpHeaders(): set Content-Type, Kiro agent headers, dynamic fingerprint User-Agent, AWS SDK identifiers, Bearer auth, and custom auth attributes
Claude request translation (kiro_claude_request.go):
- Rename web_search -> remote_web_search in convertClaudeToolsToKiro() with dynamic description from GetWebSearchDescription() or hardcoded fallback
- Rename web_search -> remote_web_search in BuildAssistantMessageStruct() for tool_use content blocks
- Add remoteWebSearchDescription constant as fallback when MCP tools/list hasn't been fetched
2026-02-11 00:02:30 +08:00
Skyuno
fe6fc628ed
Revert "fix: filter out web_search/websearch tools unsupported by Kiro API"
...
This reverts commit 5dc936a9a4 .
2026-02-10 22:24:46 +08:00
Skyuno
8192eeabc8
Revert "feat: inject web_search alternative hint instead of silently filtering"
...
This reverts commit 3c7a5afdcc .
2026-02-10 22:24:46 +08:00
y
c3f1cdd7e5
feat(config): add default Kiro model aliases for standard Claude model names
...
Kiro models are exposed with kiro- prefix (e.g., kiro-claude-sonnet-4-5),
which prevents clients like Claude Code from using standard model names
(e.g., claude-sonnet-4-20250514).
This change injects default oauth-model-alias entries for the kiro channel
when no user-configured aliases exist, following the same pattern as the
existing Antigravity defaults. The aliases map standard Claude model names
(both with and without date suffixes) to their kiro-prefixed counterparts.
Default aliases added:
- claude-sonnet-4-5-20250929 / claude-sonnet-4-5 → kiro-claude-sonnet-4-5
- claude-sonnet-4-20250514 / claude-sonnet-4 → kiro-claude-sonnet-4
- claude-opus-4-6 → kiro-claude-opus-4-6
- claude-opus-4-5-20251101 / claude-opus-4-5 → kiro-claude-opus-4-5
- claude-haiku-4-5-20251001 / claude-haiku-4-5 → kiro-claude-haiku-4-5
All aliases use fork: true to preserve the original kiro-* names.
User-configured kiro aliases are respected and not overridden.
Closes router-for-me/CLIProxyAPIPlus#208
2026-02-10 19:01:07 +08:00
Chén Mù
c6bd91b86b
Merge pull request #1519 from router-for-me/thinking
...
feat(translator): support Claude thinking type adaptive
2026-02-10 18:31:56 +08:00
hkfires
349ddcaa89
fix(registry): correct max completion tokens for opus 4.6 thinking
2026-02-10 18:05:40 +08:00
xxddff
bb9fe52f1e
Update internal/translator/codex/openai/responses/codex_openai-responses_request_test.go
...
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-02-10 18:24:58 +09:00
xxddff
afe4c1bfb7
更新internal/translator/codex/openai/responses/codex_openai-responses_request.go
...
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-02-10 18:24:26 +09:00
xxddff
865af9f19e
Implement test for user field deletion
...
Add test to verify deletion of user field in response
2026-02-10 17:38:49 +09:00
xxddff
2b97cb98b5
Delete 'user' field from raw JSON
...
Remove the 'user' field from the raw JSON as requested.
2026-02-10 17:35:54 +09:00
hkfires
938a799263
feat(translator): support Claude thinking type adaptive
2026-02-10 16:20:32 +08:00
Luis Pater
e17d4f8d98
Merge pull request #207 from router-for-me/plus
...
v6.8.9
v6.8.9-0
2026-02-10 15:43:45 +08:00
Luis Pater
c8cae1f74d
Merge branch 'main' into plus
2026-02-10 15:43:31 +08:00
Luis Pater
0040d78496
refactor(sdk): simplify provider lifecycle and registration logic
2026-02-10 15:39:26 +08:00
hkfires
896de027cc
docs(config): reorder antigravity model alias example
2026-02-10 10:13:54 +08:00
hkfires
fc329ebf37
docs(config): simplify oauth model alias example
2026-02-10 10:12:28 +08:00
Luis Pater
91841a5519
Merge branch 'router-for-me:main' into main
v6.8.8-0
2026-02-10 02:10:29 +08:00
Luis Pater
eaab1d6824
Merge pull request #1506 from masrurimz/fix-sse-model-mapping
...
fix(amp): rewrite response.model in Responses API SSE events
2026-02-10 02:08:11 +08:00
Muhammad Zahid Masruri
0cfe310df6
ci: retrigger workflows
...
Amp-Thread-ID: https://ampcode.com/threads/T-019c264f-1cb9-7420-a68b-876030db6716
2026-02-10 00:09:11 +07:00
Muhammad Zahid Masruri
918b6955e4
fix(amp): rewrite model name in response.model for Responses API SSE events
...
The ResponseRewriter's modelFieldPaths was missing 'response.model',
causing the mapped model name to leak through SSE streaming events
(response.created, response.in_progress, response.completed) in the
OpenAI Responses API (/v1/responses).
This caused Amp CLI to report 'Unknown OpenAI model' errors when
model mapping was active (e.g., gpt-5.2-codex -> gpt-5.3-codex),
because the mapped name reached Amp's backend via telemetry.
Also sorted modelFieldPaths alphabetically per review feedback
and added regression tests for all rewrite paths.
Fixes #1463
2026-02-09 23:52:59 +07:00
Luis Pater
532fbf00d4
Merge pull request #204 from router-for-me/plus
...
v6.8.7
v6.8.7-0
2026-02-09 20:00:36 +08:00
Luis Pater
45b6fffd7f
Merge branch 'main' into plus
2026-02-09 20:00:16 +08:00
Luis Pater
5a3eb08739
Merge pull request #1502 from router-for-me/iflow
...
feat(executor): add session ID and HMAC-SHA256 signature generation for iFlow API requests
2026-02-09 19:56:12 +08:00
Luis Pater
0dff329162
Merge pull request #1492 from router-for-me/management
...
fix(management): ensure management.html is available synchronously and improve asset sync handling
2026-02-09 19:55:21 +08:00
hkfires
49c1740b47
feat(executor): add session ID and HMAC-SHA256 signature generation for iFlow API requests
2026-02-09 19:29:42 +08:00
hkfires
3fbee51e9f
fix(management): ensure management.html is available synchronously and improve asset sync handling
2026-02-09 08:32:58 +08:00
Luis Pater
a3dc56d2a0
Merge branch 'router-for-me:main' into main
v6.8.6-0
2026-02-09 02:07:02 +08:00
Luis Pater
63643c44a1
Fixed : #1484
...
fix(translator): restructure message content handling to support multiple content types
- Consolidated `input_text` and `output_text` handling into a single case.
- Added support for processing `input_image` content with associated URLs.
2026-02-09 02:05:38 +08:00
Luis Pater
1d93608dbe
Merge pull request #203 from JokerRun/fix/copilot-premium-usage-inflation
...
fix(copilot): prevent premium request count inflation for Claude models
v6.8.5-1
2026-02-08 20:42:51 +08:00
Luis Pater
d125b7de92
Merge pull request #199 from ravindrabarthwal/add-claude-opus-4.6-github-copilot
...
feat: add Claude Opus 4.6 to GitHub Copilot models
2026-02-08 20:41:20 +08:00
Luis Pater
d5654ee316
Merge branch 'router-for-me:main' into main
v6.8.5-0
2026-02-08 20:40:18 +08:00
Luis Pater
3b34521ad9
Merge pull request #1479 from router-for-me/management
...
refactor(management): streamline control panel management and implement sync throttling
2026-02-08 20:37:29 +08:00
hkfires
7197fb350b
fix(config): prune default descendants when merging new yaml nodes
2026-02-08 19:05:52 +08:00