Commit History
-
refactor(executor): split providers and preserve legacy entrypoints
shinmentakezo07 +1: Claude Opus 4.6Extract provider-specific logic into refactored executors with a shared base flow, keep legacy executor files as thin compatibility wrappers, and apply static safety fixes to reduce duplication and avoid symbol/nil-path regressions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>3e5ab39
-
feat: passthrough upstream response headers to clients
Kirill TuranskiyCPA previously stripped ALL response headers from upstream AI provider APIs, preventing clients from seeing rate-limit info, request IDs, server-timing and other useful headers. Changes: - Add Headers field to Response and StreamResult structs - Add FilterUpstreamHeaders helper (hop-by-hop + security denylist) - Add WriteUpstreamHeaders helper (respects CPA-set headers) - ExecuteWithAuthManager/ExecuteCountWithAuthManager now return headers - ExecuteStreamWithAuthManager returns headers from initial connection - All 11 provider executors populate Response.Headers - All handler call sites write filtered upstream headers before response Filtered headers (not forwarded): - RFC 7230 hop-by-hop: Connection, Transfer-Encoding, Keep-Alive, etc. - Security: Set-Cookie - CPA-managed: Content-Length, Content-Encoding409fbf7
-
refactor(translator, executor): remove redundant `bytes.Clone` calls for improved performance
Unverified signature- Replaced all instances of `bytes.Clone` with direct references to enhance efficiency. - Simplified payload handling across executors and translators by eliminating unnecessary data duplication.1b0fbba -
refactor(executor): optimize payload cloning and streamline SDK translator usage
Unverified signature- Replaced unnecessary `bytes.Clone` calls for `opts.OriginalRequest` throughout executors. - Introduced intermediate variable `originalPayloadSource` to simplify payload processing. - Ensured better clarity and structure in request translation logic.c702df8
-
feat(openai): add responses/compact support
Shady KhalifaUnverified signature8f7449a
-
feat(executor): apply payload rules using requested model
hkfires69a5340
-
feat(registry): support provider-specific model info lookup
hkfires4771da8
-
refactor(thinking): pass source and target formats to ApplyThinking for cross-format validation
hkfiresUpdate ApplyThinking signature to accept fromFormat and toFormat parameters instead of a single provider string. This enables: - Proper level-to-budget conversion when source is level-based (openai/codex) and target is budget-based (gemini/claude) - Strict budget range validation when source and target formats match - Level clamping to nearest supported level for cross-format requests - Format alias resolution in SDK translator registry for codex/openai-response Also adds ErrBudgetOutOfRange error code and improves iflow config extraction to fall back to openai format when iflow-specific config is not present.4072514
-
fix(executor): properly handle thinking application errors
hkfirese934726 -
refactor: improve thinking logic
hkfiresee9e572
-
feat(executor): add HttpRequest support across executors for better http request handling
Unverified signaturea64baa3
-
feat(executor): enhance payload translation with original request context
Unverified signatureRefactored `applyPayloadConfig` to `applyPayloadConfigWithRoot`, adding support for default rule validation against the original payload when available. Updated all executors to use `applyPayloadConfigWithRoot` and incorporate an optional original request payload for translations.ae057e3
-
refactor(executor): remove redundant upstream model parameter from translateRequest
hkfires8628ab7 -
refactor(executor): resolve upstream model at conductor level before execution
hkfiresc37b7ba -
fix(executor): use upstream model for thinking config and payload translation
hkfires7559da4
-
fix(gemini): add optional skip for gemini3 thinking conversion
hkfiresbaafbd7
-
fix: apply thinkingLevel from model suffix metadata for Gemini 3
Ben VargasThe previous commit added thinkingLevel support but didn't apply it when the reasoning effort came from model name suffix (e.g., model(minimal)). This was because ResolveThinkingConfigFromMetadata returns nil for level-based models, bypassing the metadata application. Changes: - Add ApplyGemini3ThinkingLevelFromMetadata for standard Gemini API - Add ApplyGemini3ThinkingLevelFromMetadataCLI for CLI API format - Update gemini_cli_executor to apply Gemini 3 thinkingLevel from metadata - Update antigravity_executor to apply Gemini 3 thinkingLevel from metadata - Update aistudio_executor to apply Gemini 3 thinkingLevel from metadata - Add comprehensive test coverage for Gemini 3 thinkingLevel functionsa1a3463 -
feat: use thinkingLevel for Gemini 3 models per Google documentation
Ben VargasPer Google's official documentation, Gemini 3 models should use thinkingLevel (string) instead of thinkingBudget (number) for optimal performance. From Google's Gemini Thinking docs: > Use the thinkingLevel parameter with Gemini 3 models. While > thinkingBudget is accepted for backwards compatibility, using > it with Gemini 3 Pro may result in suboptimal performance. Changes: - Add model family detection functions (IsGemini3Model, IsGemini25Model, IsGemini3ProModel, IsGemini3FlashModel) - Add ApplyGeminiThinkingLevel and ApplyGeminiCLIThinkingLevel functions for applying thinkingLevel config - Add ValidateGemini3ThinkingLevel for model-specific level validation - Add ThinkingBudgetToGemini3Level for backward compatibility conversion - Update NormalizeGeminiThinkingBudget to convert budget to level for Gemini 3 models - Update ApplyDefaultThinkingIfNeeded to not set a default level for Gemini 3 (lets API use its dynamic default "high") - Update ConvertThinkingLevelToBudget to …965592d
-
refactor(thinking): export thinking helpers
hkfiresExpose thinking/effort normalization helpers from the executor package so conversion tests use production code and stay aligned with runtime validation behavior.ca524b4
-
Fixed: #534
hkfiresfix(aistudio): correct JSON string boundary detection for backslash sequences4744928
-
refactor(executor): clarify executor comments and oauth names
hkfires9cc01d9 -
refactor(executor): clarify providers and streams
hkfiresAdd package and constructor documentation for AI Studio, Antigravity, Gemini CLI, Gemini API, and Vertex executors to describe their roles and inputs. Introduce a shared stream scanner buffer constant in the Gemini API executor and reuse it in Gemini CLI and Vertex streaming code so stream handling uses a consistent configuration. Update Refresh implementations for AI Studio, Gemini CLI, Gemini API (API key), and Vertex executors to short‑circuit and simply return the incoming auth object, while keeping Antigravity token renewal as the only executor that performs OAuth refresh. Remove OAuth2-based token refresh logic and related dependencies from the Gemini API executor, since it now operates strictly with API key credentials.f3f3cbf
-
fix(executor): centralize default thinking config
hkfiresc60202a -
feat(executor): normalize thinking budget across all Gemini executors
hkfiresab09327 -
feat(aistudio): normalize thinking budget in request translation
hkfiresf8fe943
-
refactor(executor): dedupe thinking metadata helpers across Gemini executors
aurorafluxExtract applyThinkingMetadata and applyThinkingMetadataCLI helpers to payload_helpers.go and use them across all four Gemini-based executors: - gemini_executor.go (Execute, ExecuteStream, CountTokens) - gemini_cli_executor.go (Execute, ExecuteStream, CountTokens) - aistudio_executor.go (translateRequest) - antigravity_executor.go (Execute, ExecuteStream) This eliminates code duplication introduced in the -reasoning suffix PR and centralizes the thinking config application logic. Net reduction: 28 lines of code.82379d5
-
fix(aistudio): strip Gemini generation config overrides
hkfiresRemove generationConfig.maxOutputTokens, generationConfig.responseMimeType and generationConfig.responseJsonSchema from the Gemini payload in translateRequest so we no longer send unsupported or conflicting response configuration fields. This lets the backend or caller control response formatting and output limits and helps prevent potential API errors caused by these keys.8f128c6
-
Fixed: #302
Unverified signature**feat(executor): enhance WebSocket error handling and metadata logging** - Added handling for stream closure before start with appropriate error recording. - Improved metadata logging for non-OK HTTP status codes in WebSocket responses. - Consolidated event processing logic with `processEvent` for better error handling and payload management. - Refactored stream initialization to include the first event handling for smoother execution flow.edb9a12
-
feat(executor): share SSE usage filtering across streams
hkfires7dbb8b8
-
Fixed: #291
Unverified signature**feat(executor): add thinking level to budget conversion utility** - Introduced `ConvertThinkingLevelToBudget` to map thinking level ("high"/"low") to corresponding budget values. - Applied the utility in `aistudio_executor.go` before stripping unsupported configs. - Updated dependencies to include `tidwall/gjson` for JSON parsing.028d53f
-
**feat(runtime): add payload configuration support for executors**
Unverified signatureIntroduce `PayloadConfig` in the configuration to define default and override rules for modifying payload parameters. Implement `applyPayloadConfig` and `applyPayloadConfigWithRoot` to apply these rules across various executors, ensuring consistent parameter handling for different models and protocols. Update all relevant executors to utilize this functionality.a917f9b
-
fix(executor): remove `safetySettings` from payload in token counting request
Unverified signature3ffa428
-
fix(executor): only apply thinking config to supported models
hkfiresc896fd9
-
fix(executor): pass authID to relay instead of provider
hkfiresc3b5398 -
feat(registry): unify Gemini models and add AI Studio set
hkfiresf56bc9a
-
fix(aistudio): ensure colon-spaced JSON in responses
hkfires7af3f21 -
refactor(wsrelay): rename RoundTrip to NonStream
hkfires965993c -
fix(aistudio): remove generationConfig and tools when action is countTokens
hkfiresce3727e
-
fix(aistudio): strip usage metadata from non-final stream chunks
hkfiresc140413 -
feat(aistudio): track Gemini usage and improve stream errors
hkfires8c00322 -
feat: add websocket routing and executor unregister API
hkfires- Introduce Server.AttachWebsocketRoute(path, handler) to mount websocket upgrade handlers on the Gin engine. - Track registered WS paths via wsRoutes with wsRouteMu to prevent duplicate registrations; initialize in NewServer and import sync. - Add Manager.UnregisterExecutor(provider) for clean executor lifecycle management. - Add github.com/gorilla/websocket v1.5.3 dependency and update go.sum. Motivation: enable services to expose WS endpoints through the core server and allow removing auth executors dynamically while avoiding duplicate route setup. No breaking changes.7ed60dd