Skip to content

New#2

Open
Ironboxplus wants to merge 1409 commits into
mainfrom
new
Open

New#2
Ironboxplus wants to merge 1409 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
@Ironboxplus Ironboxplus force-pushed the new branch 2 times, most recently from 822d96c to 9ec6f63 Compare May 14, 2026 17:25
catoncat added 2 commits June 1, 2026 13:10
The input item ID dedupe added in router-for-me#3620 keeps only the last occurrence of
each item id. When an upstream reuses the same item id across a re-sent or
repaired tool call (so two function_call items share an id but carry
different call_ids), the last-wins rule can drop the function_call whose
call_id still has a matching function_call_output. The upstream then rejects
the request with HTTP 400 "No tool call found for function call output with
call_id ...", breaking every subsequent turn over the Codex WebSocket path.

Make the dedupe orphan-aware: when several input items share an id, never
replace an item whose call_id is still referenced by a tool-call output with
one that is not. This keeps a single item per id (preserving the original
intent) while ensuring retained tool calls stay paired with their outputs.

Adds a regression test covering two function_call items that share an id
where only the earlier call_id has a surviving output.
Address review feedback: parse each item's type/id/call_id once with
gjson.GetManyBytes and reuse it across the dedupe loops instead of
rescanning every item up to five times. Behavior is unchanged.
luispater and others added 30 commits June 19, 2026 23:50
…versions

- Updated `ConvertOpenAIRequestToGemini` and `ConvertOpenAIRequestToCodex` to handle `input_audio`, retaining `data` and `format` fields.
- Added helper `openAIInputAudioMimeType` for determining MIME types from audio formats.
- Introduced unit tests to validate correct preservation of `input_audio` data and format.

Closes: router-for-me#3447
…e is available

- Updated `ConvertCodexResponseToClaude` to delay emitting `function_call` start events until the `name` field is resolved.
- Introduced `pendingCodexFunctionCall` for buffering incomplete function calls.
- Added tests to ensure proper behavior for deferred starts, including argument buffering and finalization.

Closes: router-for-me#3471
…N schema processing

- Updated JSON schema handling to remove `$comment` and `enumDescriptions` fields during schema transformations.
- Adjusted test cases to validate the removal of these fields both at root and nested levels.
- Expanded unsupported schema keywords to include `$comment` and `enumDescriptions` for Gemini compatibility.

Closes: router-for-me#3512
…port

- Replaced direct `strings.ToLower` usage with `util.OpenAICompatibleProviderKey` for generating provider keys.
- Updated auth and executor workflows to use namespaced keys for OpenAI-compatible providers.
- Adjusted tests to validate namespaced key handling, including new test cases for provider registration and execution logic.
- Added `OpenAICompatibleProviderKey` helper in `util` for consistent key transformations.

Closes: router-for-me#3600
…ence

- Added `normalizeCodexParallelToolCallsForTools` to conditionally remove `parallel_tool_calls` when `tools` are missing or empty.
- Integrated normalization into Codex executor workflows for improved request handling.
- Introduced unit tests to validate behavior across different tool scenarios.

Closes: router-for-me#3903
…to Gemini requests

- Implemented `applyOpenAIResponsesTextFormatToGemini` to handle `json_object` and `json_schema` formats.
- Updated generation config to set appropriate `responseMimeType` and optional `responseJsonSchema`.
- Introduced unit tests to validate correct handling of `text.format` conversion scenarios.

Closes: router-for-me#3721
- Introduced `xaiRequiresIsolatedConversation` to enforce session ID generation for `grok-composer` models.
- Updated request preparation logic to handle isolated conversations by setting `prompt_cache_key` and `x-grok-conv-id`.
- Added unit tests with coverage for session isolation, stateless models, and explicit `prompt_cache_key` scenarios.

Closes: router-for-me#3750
… with large inputs

- Introduced `BenchmarkConvertSystemRoleToDeveloperLargeInput` to evaluate performance on various input sizes and configurations.
- Improved `convertSystemRoleToDeveloper` logic to optimize JSON rebuilding and reduce unnecessary operations.
- Created helper `makeLargeResponsesInputForBenchmark` to generate test data for performance scenarios.

Closes: router-for-me#3751
- Introduced `SetOAuthModelAliasesAttribute` and `OAuthModelAliasesFromAttributes` for managing per-auth model aliases.
- Enhanced OAuth model resolution logic to prioritize per-auth aliases over global aliases.
- Updated metadata handling to extract and sanitize per-account model aliases.
- Added tests to validate alias precedence, empty attributes, and conflict scenarios.

Closes: router-for-me#3764
- Introduced `RebuildMidSystemMessage` field in config to move system messages into the top-level Claude system field.
- Updated executor to handle mid-system message rebuilding when enabled via config or auth attributes.
- Added unit tests to verify rebuilding behavior and default behavior when disabled.
- Updated configuration example and API handlers to support the new field.

Closes: router-for-me#3792
…l handling

- Replaced internal model-specific constants with exported defaults (`DefaultClaudeMaxInputTokens`, `DefaultClaudeMaxOutputTokens`).
- Refactored Claude model formatting to centralize schema application in `formatHomeClaudeModel`, with fields like `type`, `display_name`, and token limits.
- Added new unit tests for fallback behavior, metadata fields, and token handling in Claude and Gemini models.
- Removed deprecated test coverage for Amp provider model routes.

Closes: router-for-me#3833
… request handling

- Applied `CleanJSONSchemaForGemini` to ensure compatibility by removing unsupported fields and cleaning schema requirements.
- Added test cases to validate schema transformation, ensuring only necessary `required` fields are retained.
- Enhanced both request and response flows to consistently clean and sanitize tool parameter schemas.

Closes: router-for-me#3863
…set functionality

- Introduced a new `/reset-quota` API endpoint in the management handler to clear quota and cooldown state for auth records.
- Implemented `ResetQuota` method in the auth manager to handle runtime and registry state resets for affected models.
- Added tests to validate quota reset behavior, including proper state updates and registry consistency.
- Refactored utility functions to support deduplication and registered models handling in quota resets.

Closes: router-for-me#3866
…Gemini requests

- Updated `ConvertGeminiRequestToOpenAI` to consume `tool_call_id`s in FIFO order, ensuring consistent mapping between calls and responses.
- Added fallback logic for unmatched or extra function responses to generate unique `tool_call_id`s with a `call_` prefix.
- Introduced comprehensive unit tests to validate order enforcement, distinct ID assignment, and fallback behavior.

Closes: router-for-me#3874
…request and response translations

- Updated `ConvertGeminiRequestToClaude`, `ConvertGeminiRequestToCodex`, and their respective response counterparts to include logic for retaining and using tool/call IDs when present from gateway-provided inputs.
- Enhanced pairing logic between function calls and responses to handle custom and auto-generated IDs consistently.
- Introduced tests validating ID preservation and proper behavior in both streaming and non-streaming flows.

Closes: router-for-me#3878
- Added a new "max" level to model `thinking.levels` for enhanced customization.
- Removed deprecated Gemini 3 Pro (High/Low) models and associated fields from the registry.
- Simplified `thinking` attribute structure for `grok-build-0.1` and `grok-composer-2.5-fast` models.

Closes: router-for-me#3901
- Updated `ConvertOpenAIRequestToGemini` to process `video_url` message types, extracting and embedding video metadata (MIME type and base64 data) into Gemini request parts.
- Added corresponding unit tests to validate `video_url` handling, ensuring proper extraction and data preservation.

Closes: router-for-me#3920
…eplay-fc-order-upstream-dev

fix(antigravity): HOME Gemini replay and functionCall ordering before functionResponse
…ent models

- Introduced a new "max" level for reasoning depth in Codex client model configuration, providing maximum problem-solving capability.
- Added `service_tiers` field to model responses for better tier categorization.
- Updated unit tests to validate the inclusion and default behavior of `service_tiers` and the new "max" reasoning depth.
…ority calculation logic

- Added `applyCodexClientNonTemplatePriorities` to assign higher priorities to non-template Codex client models dynamically.
- Implemented `maxCodexClientTemplatePriority` to set base priority for non-template models relative to template models.
- Updated unit tests to validate priority calculation for custom models.
- Added logic to expand single auth JSON payloads into multiple plugin virtual auth records.
- Updated related API endpoints such as `PatchAuthFileStatus` and `DeleteAuthFile` to handle plugin virtual auths with rollback mechanisms.
- Introduced `NormalizePluginOAuthCallbackProvider` and other normalization functions for better handling of OAuth callbacks.
- Enhanced tests to validate multi-auth parsing, rollback behavior, and API response consistency.
…lugin calls

- Added `rpcPluginError` to encapsulate plugin errors with HTTP status codes.
- Enhanced `decodeEnvelopeResult` to preserve and return detailed plugin errors with status codes.
- Introduced `isPluginErrorEnvelope` to identify plugin error envelopes.
- Updated plugin call logic in Unix and Windows loaders to differentiate plugin errors from system errors.
- Added unit tests to verify error handling and status code preservation.
… configuration

- Implemented `unregisterOpenAICompatExecutor` to remove OpenAI-compatible executors dynamically.
- Updated `ensureExecutorsForAuth` to unregister incompatible executors while handling plugin candidates.
- Adjusted runtime configuration logic to ensure proper synchronization during updates with `syncPluginModelRuntime`.
… for compatibility grouping

- Extracted provider key determination into `apiKeyUsageProviderKey` for reuse and better readability.
- Updated `GetAPIKeyUsage` to utilize the new function.
- Added a new test case to validate compatibility grouping logic via `compat_name` attribute.

Closes: router-for-me#3940 router-for-me#3941
Merge upstream/main into new. Major upstream changes pulled in:
- Removed gemini-cli provider and amp integration (feat!: remove amp)
- New pluginstore subsystem, videos handlers, websockets executors
- translator refactors (Gemini video URLs, tool/call ID handling, cache token detail)
- management log cursors, config-snapshot-based reload

Conflict resolution (kept both optimizations; preferred upstream's canonical/refactored code on conflict):
- internal/registry/model_definitions.go: kept both new consts/builtins
  (local claudeBuiltinFableModelInfo + upstream codexBuiltinImage15ModelInfo,
  normalizeAntigravityCapabilityModelID); aligned Fable 5 builtin metadata to
  upstream's canonical models.json values (created/description).
- internal/registry/models/models.json: took upstream's canonical Fable 5 metadata.
- internal/registry/model_updater.go: dropped GeminiCLI field from mergeModelCatalog
  (upstream removed the gemini-cli provider / staticModelsJSON.GeminiCLI).
- internal/runtime/executor/helps/usage_helpers_test.go: kept local Claude cache-token
  tests (fork optimization preserved); repointed orphaned ParseGeminiCLI* tests to the
  surviving ParseGeminiUsage/ParseGeminiStreamUsage after upstream's refactor; dropped
  the traffic-only-guard test (upstream removed hasGeminiFamilyUsageTokenFields).

Added TDD coverage:
- internal/registry/model_definitions_fable_test.go: guarantees Fable 5 builtin
  presence via WithClaudeBuiltins and enforces builtin/models.json metadata consistency
  (red->green verified).

Verification: go build OK, go vet unchanged (pre-existing warnings only),
go test ./... — the only failures (Codex image-edit, XAI reasoning-effort, Gemini
reasoning-signature) are confirmed pre-existing on clean upstream/main.
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.