Skip to content

New#2

Open
Ironboxplus wants to merge 1152 commits into
mainfrom
new
Open

New#2
Ironboxplus wants to merge 1152 commits into
mainfrom
new

Conversation

@Ironboxplus
Copy link
Copy Markdown
Owner

No description provided.

@Ironboxplus Ironboxplus force-pushed the new branch 6 times, most recently from dae9fcf to c55780c Compare January 24, 2026 06:39
@Ironboxplus Ironboxplus force-pushed the new branch 3 times, most recently from 1c05e6a to 08e2429 Compare February 10, 2026 14:46
@Ironboxplus Ironboxplus force-pushed the new branch 4 times, most recently from 82e53c6 to 982b813 Compare February 20, 2026 14:38
@Ironboxplus Ironboxplus force-pushed the new branch 2 times, most recently from f53e4cc to ab55e95 Compare March 6, 2026 06:46
@Ironboxplus Ironboxplus force-pushed the new branch 4 times, most recently from 2293a13 to 06dff20 Compare March 14, 2026 05:27
@Ironboxplus Ironboxplus force-pushed the new branch 2 times, most recently from ed8b239 to 4888395 Compare March 23, 2026 14:29
@Ironboxplus Ironboxplus force-pushed the new branch 2 times, most recently from 9582f7c to 6b7618e Compare March 30, 2026 10:48
@Ironboxplus Ironboxplus force-pushed the new branch 2 times, most recently from 309a7d4 to ba191cd Compare April 8, 2026 14:17
luispater and others added 5 commits April 26, 2026 03:09
- 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.
luispater and others added 30 commits May 27, 2026 02:10
…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
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.