You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Enhance Gemini integration with smart API detection and model consistency
This release significantly improves the Gemini integration with automatic API
detection, OAuth token refresh, project onboarding, and consistent model defaults
across the codebase.
Major Features:
- Smart base URL detection: Auto-selects Cloud Code API for OAuth users and
Standard Gemini API for API key users
- Automatic OAuth token refresh with 5-minute buffer before expiry
- Gemini project onboarding flow with polling and persistence
- Racing provider support for concurrent model requests with fallback
- Request/response format adaptation based on authentication type
- Comprehensive metrics tracking and monitoring
- File backup system for write operations
Gemini Improvements:
- Added getBaseURL() method for dynamic API selection
- Added getEndpoint() method for correct endpoint formatting
- Conditional request/response handling (Cloud Code wrapper vs direct format)
- Exported ProjectIDRequiredError with IsProjectIDRequired() helper
- Enhanced logging to show which API is being used
- Project ID persistence to config file to avoid re-onboarding
- Added Content.Role field for proper API compatibility
Model Consistency:
- Standardized default model to gemini-2.0-flash-exp across all locations
- Updated wizard prompts and defaults
- Updated mergeWithExistingConfig() fallback
- Updated generateYAML() fallback
- Added gemini-2.0-flash-exp to provider model list
- Updated GetDefaultModel() return value
Configuration:
- Changed base_url default from hardcoded to empty string for auto-detection
- Enhanced wizard with Gemini OAuth onboarding integration
- Improved config merging for existing configurations
- Added proper OAuth credential handling
API Enhancements:
- Added CloudCodeRequestWrapper and CloudCodeResponseWrapper types
- Implemented LoadCodeAssistRequest/Response types
- Added OnboardUserRequest and LongRunningOperationResponse types
- Enhanced error handling with proper error type exports
- Racing provider with grace period and concurrent model support
- Model selector for intelligent model routing
Infrastructure:
- Added metrics server with Prometheus-style endpoints
- Request/response tracking and statistics
- File backup system for safe write operations
- Enhanced router with racing and fallback support
- Improved logging throughout the codebase
Cleanup:
- Removed test-gemini development command
- Cleaned up temporary test artifacts
- Removed legacy_router.go (replaced by enhanced router)
Breaking Changes: None - all changes maintain backward compatibility
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments