Split the 3,891 line kiro_executor.go into focused modules:
- kiro_executor.go (966 lines): Main executor, public interface
- kiro_auth.go (462 lines): Authentication/credential logic
- kiro_request.go (422 lines): Request transformation and retry logic
- kiro_response.go (1,765 lines): Response handling/streaming
Fix: Corrected isRetryableError to use errors.As for EventStreamError
type assertion instead of errors.Is on string constants.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Split the 2,280-line conductor.go into three focused files:
- conductor.go (1,416 lines): Core types, Manager struct, execution
- conductor_oauth.go (383 lines): OAuth/API key model alias resolution
- conductor_token.go (501 lines): Token refresh and HTTP request handling
This is a pure refactor with no logic changes.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Replace `for i, part := range` with `for _, part := range` since the
index variable was captured but never used (just discarded with `_ = i`).
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Remove the V1 RouteModule interface which was marked as deprecated.
All modules now use RouteModuleV2 exclusively. The RegisterModule
function signature is simplified to accept RouteModuleV2 directly
instead of interface{}.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Remove TODO marker and update comment to indicate the stub is
intentional for API compatibility, not incomplete work.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Update FileVersion and ProductVersion in versioninfo.json files
from 0.1.6 to 0.3.0 for both proxypilot-tray and server commands.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Cherry-picked from upstream 6d8609e4
Allows configuring rules to remove specific JSON paths from request/response payloads.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Cherry-picked from upstream 7ff3936e
Adds multi-turn cache control tests.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Cherry-picked from upstream 6b6d030e
Adds uTLS-based HTTP transport to mimic browser TLS fingerprints for Claude API.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Cherry-picked from upstream ca796510
Uses post-order traversal and DeleteBytes for better performance.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Cherry-picked from upstream 2666708c
When Claude API sends an assistant message with empty text content,
the translator was creating an empty part, causing Gemini API to return
"required oneof field 'data' must have one initialized field" error.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Tool outputs like "[1,2,3]\n\n[Process exited with code 0]" were being
partially parsed by gjson.Parse() which would extract just "[1,2,3]" and
lose the trailing text. This caused invalid JSON in the Gemini request.
Fix: Use gjson.Valid() to verify the ENTIRE string is valid JSON before
treating it as raw JSON. If validation fails, treat as a string with
proper escaping via sjson.Set().
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Tests were failing with "auth_not_found: no auth available" because the
conductor.pickNextMixed() function checks ClientSupportsModel() against
the global registry. Test auths weren't registered with their models.
Changes:
- sdk/cliproxy/auth/conductor_test.go: Add registry.RegisterClient calls
- internal/translator/gemini/.../gemini_openai-responses_request.go:
Skip empty text parts to avoid invalid Gemini content
Note: Some pre-existing flaky tests remain in test/integration and
internal/translator/gemini (NonJSON tool output test).
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
- Add SupportedEndpoints field to ModelInfo
- Add GetMiniMaxModels, GetZhipuModels stub functions
- Add GetGitHubCopilotModels, GetKiroModels, GetAmazonQModels
- Update model registry with new providers
Cherry-picked and merged from plus remote.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
When all oauth-model-alias entries are deleted, ensure an empty map
is persisted to config file rather than being omitted entirely.
Fixes#1305
Cherry-picked from upstream: a709e5a1
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
- Add firstChunkTimestamp field to ResponseWriterWrapper for sync capture
- Capture TTFB in Write() and WriteString() before async channel send
- Add SetFirstChunkTimestamp() to StreamingLogWriter interface
- Make requestTimestamp/apiResponseTimestamp required in LogRequest()
- Remove timestamp capture from WriteAPIResponse() (now via setter)
- Fix Gemini handler to set API_RESPONSE_TIMESTAMP before writing response
This ensures accurate TTFB measurement for all streaming API formats
(OpenAI, Gemini, Claude) by capturing timestamp synchronously when
the first response chunk arrives, not when the stream finalizes.
Cherry-picked from upstream: 295f34d7
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Previously:
- REQUEST INFO timestamp was captured at log write time (not request arrival)
- API RESPONSE had NO timestamp at all
This fix:
- Captures REQUEST INFO timestamp when request first arrives
- Adds API RESPONSE timestamp when upstream response arrives
- Add Timestamp field to RequestInfo, set at middleware initialization
- Set API_RESPONSE_TIMESTAMP in appendAPIResponse() and gemini handler
- Pass timestamps through logging chain to writeNonStreamingLog()
- Add timestamp output to API RESPONSE section
Cherry-picked from upstream: c41ce77e
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
When using Gemini API format with Antigravity backend, the executor
renames usageMetadata to cpaUsageMetadata in non-terminal chunks.
The Gemini translator was returning this internal field name directly
to clients instead of the standard usageMetadata field.
Add restoreUsageMetadata() to rename cpaUsageMetadata back to
usageMetadata before returning responses to clients.
Cherry-picked from upstream: 9dc0e6d0
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Add migration logic for converting oauth-model-mappings to oauth-model-alias
with comprehensive test coverage.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
Add empty auth provider for handling requests that don't require authentication.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>