Commit Graph

12 Commits

  • feat(registry/runtime): add Gemini 2.5 model and increase buffer sizes
    - 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.
  • feat(auth): improve OpenAI compatibility normalization and API key handling
    - Refined trimming and normalization logic for `baseURL` and `apiKey` attributes.
    - Updated `Authorization` header logic to omit empty API keys.
    - Enhanced compatibility processing by handling empty `api-key-entries`.
    - Improved legacy format fallback and added safeguards for empty credentials across executor paths.
  • feat(runtime): introduce newProxyAwareHTTPClient for enhanced proxy handling
    - 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.
  • feat(usage): implement usage tracking infrastructure across executors
    - 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.
  • feat(executor): add CountTokens support across all executors
    - Introduced `CountTokens` method to Codex, Claude, Gemini, Qwen, OpenAI-compatible, and other executors.
    - Implemented `ExecuteCount` in `AuthManager` for token counting via provider round-robin.
    - Updated handlers to leverage `ExecuteCountWithAuthManager` for streamlined token counting.
    - Added fallback and error handling logic for token counting requests.
  • chore(executor): add debug logging for API request errors
    - Added detailed debug logs in all executors (Codex, Claude, Gemini, Qwen, OpenAI-compatible) to capture HTTP status and response body for failed API requests.
  • feat(openai-compat): enhance provider key handling and model resolution
    - Introduced dynamic `providerKey` resolution for OpenAI-compatible providers, incorporating attributes like `provider_key` and `compat_name`.
    - Implemented upstream model overrides via `resolveUpstreamModel` and `overrideModel` methods in the OpenAI executor.
    - Updated registry logic to correctly store provider mappings and register clients using normalized keys.
    - Ensured consistency in handling empty or default provider names across components.
  • chore(logging): add debug logs for executor Refresh methods
    - Introduced `logrus` for structured debugging across all executors.
    - Added debug log messages in `Refresh` methods for better traceability.
    - Updated `Manager` to log additional details during refresh checks.
  • refactor: standardize constant naming and improve file-based auth handling
    - Renamed constants from uppercase to CamelCase for consistency.
    - Replaced redundant file-based auth handling logic with the new `util.CountAuthFiles` helper.
    - Fixed various error-handling inconsistencies and enhanced robustness in file operations.
    - Streamlined auth client reload logic in server and watcher components.
    - Applied minor code readability improvements across multiple packages.