New#2
Open
Ironboxplus wants to merge 1152 commits into
Open
Conversation
dae9fcf to
c55780c
Compare
1c05e6a to
08e2429
Compare
82e53c6 to
982b813
Compare
f53e4cc to
ab55e95
Compare
2293a13 to
06dff20
Compare
ed8b239 to
4888395
Compare
9582f7c to
6b7618e
Compare
309a7d4 to
ba191cd
Compare
- Updated `buildImagesResponsesRequest` to derive `model` dynamically based on `toolJSON`. - Adjusted streaming execution to handle dynamic model resolution across multiple contexts. Closes: router-for-me#2965
…named remapOAuthToolNames renames lowercase client-sent tools (e.g. `glob` → `Glob`) to Claude Code equivalents on OAuth requests to avoid tool-name fingerprinting. The reverse pass previously ran against a *global* reverse map and rewrote every tool_use block whose name matched any value in oauthToolRenameMap — regardless of what the client actually sent. For clients that send mixed casing (notably Amp CLI — `Bash`, `Read`, `Grep`, `Task` alongside `glob`, `skill`, etc.) this corrupted the response. Any forward rename in the request set the "renamed" flag, which then unconditionally lowercased every `Bash` in the response to `bash`. Amp's tool registry has `Bash`, not `bash`, so it rejected the tool_use with `tool "bash" is not allowed for smart mode` and tool execution failed. Fix: `remapOAuthToolNames` now returns a per-request map keyed on the upstream (TitleCase) name valued with the original client-sent name. The reverse functions take this map and only touch entries in it. Names the client sent in TitleCase pass through untouched in both directions. - Change remapOAuthToolNames signature from `([]byte, bool)` to `([]byte, map[string]string)`; populate at every rename site (tools[], tool_choice.name, message tool_use, tool_reference, nested tool_reference inside tool_result). - Change reverseRemapOAuthToolNames and reverseRemapOAuthToolNamesFromStreamLine to accept and consume the per-request map; remove the global oauthToolRenameReverseMap. - Update all three executor call sites (Execute, ExecuteStream direct passthrough, ExecuteStream translated) + count_tokens. - Add regression tests for the mixed-case scenario in both the non-streaming and SSE code paths.
Address Gemini code review suggestion: the reverseMap can contain at most len(oauthToolRenameMap) entries, so pre-allocating avoids reallocations as entries are added.
…de-OpenAI conversions - Introduced support for processing `encrypted_content` reasoning signatures in request and response translations. - Updated `ConvertOpenAIResponsesRequestToClaude` and `ConvertClaudeResponseToOpenAIResponses` to handle reasoning signatures and summaries. - Added tests to validate signature preservation and correct reasoning content transformation in both streaming and non-streaming scenarios. - Refactored processing logic to ensure reasoning content flushing before user messages.
Notable upstream changes: - xAI/Grok provider support (OAuth, image/video models, tool normalization) - Gemini 3.5 Flash model registration - Home control plane: Redis, TLS, cluster, mTLS bootstrap - FileBodySource for large log sections - Claude codex tool call ID shortening - Streaming tool_use stabilization - HTTP CONNECT proxy dialer - Claude Code attribution stripping - Reasoning effort in usage events Conflict resolution: - internal/logging/request_logger.go: kept our writeLog closure refactoring with error log support, adopted upstream's new requestID param and FileBodySource params for writeNonStreamingLog
…levels in usage reporting - Introduced `SetTranslatedReasoningEffort` method in `UsageReporter` to capture and log reasoning efforts from translated payloads. - Updated executors to incorporate the new reporting functionality for handling reasoning efforts across various providers. - Enhanced logging for thinking level extraction with new helper function `ExtractTranslatedReasoningEffort`.
…nce metrics - Introduced Time-To-First-Token (TTFT) measurement and reporting across major executors. - Added TTFT calculation to `UsageReporter`, including support for HTTP clients and WebSocket communication. - Updated tests to validate TTFT tracking in streamed and non-streamed scenarios. - Ensured integration with `usage` plugin and augmented usage records with TTFT data.
…ation logic - Added `assertFileBodySourceCleaned` helper to streamline cleanup validations in tests. - Introduced handling to recreate missing directories during file source operations. - Enhanced tests to verify behavior after manual directory removal, ensuring robustness. - Fixed edge cases in log file merging when parts are missing.
…tests - Updated `TotalTokens` calculation to account for `CacheReadTokens` and `CacheCreationTokens`. - Added tests to validate accurate token aggregation and fallback behavior for `CachedTokens`.
- Introduced `service_tier` metadata key to capture client-requested service tiers. - Updated usage records, context propagation, and plugins to include service tier data. - Added default handling logic for cases where `service_tier` is absent. - Implemented tests for `service_tier` extraction, defaults, and updates across components.
…eck-extraction refactor: extract signature validation
…thropic-tool-name-reverse-map fix(amp): restore response tool casing from request
Notable upstream changes: - Claude Opus 4.8 model registration - Service tier tracking and defaults in usage reporting - Cache tokens included in total token calculation (upstream approach) - Signature validation extraction - TTFT (time-to-first-token) tracking - Reasoning effort tracking in translated payloads - Deprecated GPT-5.x models removed from codex-free catalog - File-backed source cleanup improvements Conflict resolution (14 files): - usage_helpers.go: adopted upstream's cleaner parseClaudeUsageNode (TotalTokens = input + output + cacheRead + cacheCreation, no InputTokens inflation), kept CacheReadTokens/CacheCreationTokens fields - usage_helpers_test.go: updated cache test expectations to match upstream - request_logger.go: kept our writeLog closure + error log support, accepted upstream's FileBodySource cleanup improvements - All other files: accepted upstream's serviceTier/TTFT additions
feat(logging): add HomeAppLogForwarder for application log forwarding
…ntercept-on-pr feat: intercept incompatible signature replay
feat(logging): add request_id handling in HomeAppLogForwarder and tests
… payloads are validated Closes: router-for-me#3619
…ut-id-dedupe fix(openai): dedupe response websocket input item IDs
- Added `sanitizeDownstreamWebsocketFallbackRequest` to clean `generate` from payload for HTTP fallback requests. - Implemented tests to validate payload handling logic in WebSocket-to-HTTP transitions. Closes: router-for-me#3556
…-for-me/CLIProxyAPI into dev # Conflicts: # internal/translator/gemini/openai/responses/gemini_openai-responses_request_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.