Commit Graph

9 Commits

  • **fix(translator): reintroduce thoughtSignature bypass logic for model parts**
    - Restored `thoughtSignature` validator bypass for model-specific parts in Gemini content processing.
    - Removed redundant logic from the `executor` for cleaner handling.
  • **chore(executor): update default agent version and simplify const formatting**
    - Updated `defaultAntigravityAgent` to version `1.11.5`.
    - Adjusted const value formatting for improved readability.
    
    **feat(executor): introduce fallback mechanism for Antigravity base URLs**
    
    - Added retry logic with fallback order for Antigravity base URLs to handle request errors and rate limits.
    - Refactored base URL handling with `antigravityBaseURLFallbackOrder` and related utilities.
    - Enhanced error handling in non-streaming and streaming requests with retry support and improved metadata reporting.
    - Updated `buildRequest` to support dynamic base URL assignment.
  • **feat(executor, translator): enhance token handling and payload processing**
    - Improved Antigravity executor to handle `thinkingConfig` adjustments and default `thinkingBudget` when `thinkingLevel` is removed.
    - Updated translator response handling to set default values for output token counts when specific token data is missing.
  • **feat(executor): add model alias mapping and improve Antigravity payload handling**
    - Introduced `modelName2Alias` and `alias2ModelName` functions for mapping between model names and aliases.
    - Improved Antigravity payload transformation to include alias-to-model name conversion.
    - Enhanced processing for Claude Sonnet models to adjust template parameters based on schema presence.
  • **feat(translator): add Antigravity translation logic**
    - Introduced request and response translation functions to enable compatibility between OpenAI Chat Completions API and Antigravity.
    - Registered translation utilities for both streaming and non-streaming scenarios.
    - Added support for reasoning content, tool calls, and metadata handling.
    - Established request normalization and embedding for Antigravity-compatible payloads.
    - Added new fields to `Params` struct for better tracking of finish reasons, usage metadata, and tool usage.
    - Refactored handling of response transitions, final events, and state-driven logic in `ConvertAntigravityResponseToClaude`.
    - Introduced `appendFinalEvents` and `resolveStopReason` helper functions for cleaner separation of concerns.
    - Added `TotalTokenCount` field to `Params` struct for enhanced token tracking.
    - Updated token count calculations to fallback on `TotalTokenCount` when specific counts are missing.
    - Introduced `hasNonZeroUsageMetadata` function to validate presence of token data in `usage_metadata`.
  • **feat(auth, executor, cmd): add Antigravity provider integration**
    - Implemented OAuth login flow for the Antigravity provider in `auth/antigravity.go`.
    - Added `AntigravityExecutor` for handling requests and streaming via Antigravity APIs.
    - Created `antigravity_login.go` command for triggering Antigravity authentication.
    - Introduced OpenAI-to-Antigravity translation logic in `translator/antigravity/openai/chat-completions`.
    
    **refactor(translator, executor): update Gemini CLI response translation and add Antigravity payload customization**
    
    - Renamed Gemini CLI translation methods to align with response handling (`ConvertGeminiCliResponseToGemini` and `ConvertGeminiCliResponseToGeminiNonStream`).
    - Updated `init.go` to reflect these method changes.
    - Introduced `geminiToAntigravity` function to embed metadata (`model`, `userAgent`, `project`, etc.) into Antigravity payloads.
    - Added random project, request, and session ID generators for enhanced tracking.
    - Streamlined `buildRequest` to use `geminiToAntigravity` transformation before request execution.