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): add request_id to error logs
hkfiresExtract error.message from JSON error responses when summarizing error bodies for debug logs2511652
-
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): resolve upstream model at conductor level before execution
hkfiresc37b7ba -
feat(gemini): add per-key model alias support for Gemini provider
hkfirese4d3e38
-
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
-
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
-
Merge pull request #481 from sususu98/fix/increase-buffer-size
Unverified signaturefix: increase buffer size for stream scanners to 50MB across multiple executorsa2d15c3
-
feat(util): implement dynamic thinking suffix normalization and refactor budget resolution logic
Unverified signature- Added support for parsing and normalizing dynamic thinking model suffixes. - Centralized budget resolution across executors and payload helpers. - Retired legacy Gemini-specific thinking handlers in favor of unified logic. - Updated executors to use metadata-based thinking configuration. - Added `ResolveOriginalModel` utility for resolving normalized upstream models using request metadata. - Updated executors (Gemini, Codex, iFlow, OpenAI, Qwen) to incorporate upstream model resolution and substitute model values in payloads and request URLs. - Ensured fallbacks handle cases with missing or malformed metadata to derive models robustly. - Refactored upstream model resolution to dynamically incorporate metadata for selecting and normalizing models. - Improved handling of thinking configurations and model overrides in executors. - Removed hardcoded thinking model entries and migrated logic to metadata-based resolution. - Updated payload mutations to always include the resolved model.db58889 -
fix(executor): increase buffer size for stream scanners to 50MB across multiple executors
sususu864db07
-
fix(executor): centralize default thinking config
hkfiresc60202a -
feat(executor): normalize thinking budget across all Gemini executors
hkfiresab09327
-
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(gemini): parse stream usage from JSON, skip thoughtSignature
hkfiresb683a9d -
fix(gemini): filter SSE usage metadata in streams
hkfires7679dfd
-
**fix(runtime): simplify scanner buffer allocation in executor implementations**
Unverified signature09adea3
-
**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
-
feat(config): support HTTP headers across providers
hkfirese6bdaef
-
fix(executor): remove `safetySettings` from payload for Gemini requests
Unverified signature0f6a6da
-
feat(gemini): add Gemini API key endpoints
hkfires569d918
-
refactor(executor): summarize API error bodies of html in debug logs
hkfires62f6af9
-
fix(executor): only apply thinking config to supported models
hkfiresc896fd9
-
fix(gemini-executor): uppercase responseModalities
hkfires36885d1
-
Refactor executor error handling and usage reporting
Unverified signature- Updated the Execute methods in various executors (GeminiCLIExecutor, GeminiExecutor, IFlowExecutor, OpenAICompatExecutor, QwenExecutor) to return a response and error as named return values for improved clarity. - Enhanced error handling by deferring failure tracking in usage reporters, ensuring that failures are reported correctly. - Improved response body handling by ensuring proper closure and error logging for HTTP responses across all executors. - Added failure tracking and reporting in the usage reporter to capture unsuccessful requests. - Updated the usage logging structure to include a 'Failed' field for better tracking of request outcomes. - Adjusted the logic in the RequestStatistics and Record methods to accommodate the new failure tracking mechanism.b9ad503
-
Enhance logging for API requests and responses across executors
Unverified signature- Added detailed logging of upstream request metadata including URL, method, headers, and body for Codex, Gemini, IFlow, OpenAI Compat, and Qwen executors. - Implemented error logging for API response failures to capture errors during HTTP requests. - Introduced structured logging for authentication details (AuthID, AuthLabel, AuthType, AuthValue) to improve traceability. - Updated response logging to include status codes and headers for better debugging. - Ensured that all executors consistently log API interactions to facilitate monitoring and troubleshooting.5b50851 -
Feature: #103
Unverified signaturefeat(gemini): add Gemini thinking configuration support and metadata normalization - Introduced logic to parse and apply `thinkingBudget` and `include_thoughts` configurations from metadata. - Enhanced request handling to include normalized Gemini model metadata, preserving the original model identifier. - Updated Gemini and Gemini-CLI executors to apply thinking configuration based on metadata overrides. - Refactored handlers to support metadata extraction and cloning during request preparation.a382a67
-
feat(registry, executor, util): add support for `gemini-2.5-flash-image-preview` and improve aspect ratio handling
Unverified signature- Introduced `gemini-2.5-flash-image-preview` model to the registry with updated definitions. - Enhanced Gemini CLI and API executors to handle image aspect ratio adjustments for the new model. - Added utility function to create base64 white image placeholders based on aspect ratio configurations.147d05d
-
fix(gemini): Disable thinking config for incompatible models
hkfires5c4667a
-
feat(registry/runtime): add Gemini 2.5 model and increase buffer sizes
Unverified signature- Added new "Gemini 2.5 Flash Image Preview" model definition, with enhanced image generation capabilities. - Increased scanner buffer size to 20,971,520 bytes across executors and translators to handle larger payloads.40079ee
-
feat(runtime): introduce `newProxyAwareHTTPClient` for enhanced proxy handling
Unverified signature- Added `newProxyAwareHTTPClient` to centralize proxy configuration with priority on `auth.ProxyURL` and `cfg.ProxyURL`. - Integrated enhanced proxy support across executors for HTTP, HTTPS, and SOCKS5 protocols. - Refactored redundant HTTP client initialization to use `newProxyAwareHTTPClient` for consistent behavior.41556b2
-
refactor(config): migrate to `SDKConfig` and streamline proxy handling
Unverified signature- Replaced `config.Config` with `config.SDKConfig` across components for simpler configuration management. - Updated proxy setup functions and handlers to align with `SDKConfig` improvements. - Reorganized handler imports to match new SDK structure.8dfd8c7
-
rebuild branch
Unverified signaturee83d8c5 -
remove all
Unverified signaturecf2b83d
-
chore(docs): add and refine package-level comments across modules
Unverified signature- Added detailed package-level comments to improve documentation coverage. - Clarified parameter descriptions, return types, and functionality of exported methods across packages. - Enhanced overall code readability and API documentation consistency.02e5e07 -
fix(gemini): handle "[DONE]" chunk, trim "data:" prefix, and remove session_id from requests
Unverified signature- Adjusted stream handling to skip "[DONE]" chunks. - Ensured "data:" prefix is trimmed for non-prefixed input in translation. - Removed `session_id` from request bodies before processing.3210b4f -
refactor(executor): remove ClientAdapter and legacy fallback logic
Unverified signature- Deleted `ClientAdapter` implementation and associated fallback methods. - Removed legacy executor logic from `codex`, `claude`, `gemini`, and `qwen` executors. - Simplified `handlers` by eliminating `UnwrapError` handling and related dependencies. - Cleaned up `model_registry` by removing logic associated with suspended clients. - Updated `.gitignore` to ignore `.serena/` directory.9f9f2e1 -
feat(translators): add token counting support for Claude and Gemini responses
Unverified signature- Implemented `TokenCount` transform method across translators to calculate token usage. - Integrated token counting logic into executor pipelines for Claude, Gemini, and CLI translators. - Added corresponding API endpoints and handlers (`/messages/count_tokens`) for token usage retrieval. - Enhanced translation registry to support `TokenCount` functionality alongside existing response types.59230c1
-
feat(usage): implement usage tracking infrastructure across executors
Unverified signature- Added `LoggerPlugin` to log usage metrics for observability. - Introduced a new `Manager` to handle usage record queuing and plugin registration. - Integrated new usage reporter and detailed metrics parsing into executors, covering providers like OpenAI, Codex, Claude, and Gemini. - Improved token usage breakdown across streaming and non-streaming responses.13abc2b
-
feat(gemini-executor): implement `CountTokens` method with request translation and API integration
Unverified signature- Added `CountTokens` for token counting requests in Gemini executor. - Integrated request translation via `sdktranslator` and response handling. - Improved error handling, logging, and API request configuration with headers.7d6ee1a