1. add Gemini /models and /v1beta/models discovery endpoints for newapi compatibility
2. persist tmp cache in Docker and lock cache_timeout=0 behavior with regression tests
3. refine image generation status flow to show captcha verification after uploads
Add a preprocessing layer before request handling that converts simplified
model names to internal MODEL_CONFIG keys based on generationConfig parameters
(aspectRatio, imageSize).
Changes:
- New src/core/model_resolver.py: model name resolution engine
- IMAGE_BASE_MODELS: 4 base image model aliases (gemini-2.5-flash-image,
gemini-3.0-pro-image, gemini-3.1-flash-image, imagen-4.0-generate-preview)
- VIDEO_BASE_MODELS: 13 base video model aliases with landscape/portrait mapping
- Supports Gemini ratio formats (16:9, 9:16, 1:1, 4:3, 3:4) and named formats
- Supports imageSize (2k, 4k) for compatible models
- Graceful fallback: unsupported ratio/size degrades to defaults
- Passthrough: existing MODEL_CONFIG keys and unknown models unchanged
- Modified src/core/models.py: extended ChatCompletionRequest
- Added ImageConfig, GenerationConfigParam Pydantic models
- Added generationConfig, contents optional fields
- Enabled extra='allow' for extra_body passthrough compatibility
- Modified src/api/routes.py: integrated resolver
- Added resolve_model_name() call before request processing
- Added /v1/models/aliases endpoint to list available aliases
Verified: 64/64 model key mappings match MODEL_CONFIG, 15 edge case tests pass.
- Extract image from URL or base64 instead of base64 only
- Add support for downloading remote image URLs starting with http/https
- Implement error handling for image download failures
- Add debug logging for image processing steps
fix(config): update model keys for veo_3_0 video generation
- Update veo_3_0_r2v_fast_portrait model key to
veo_3_0_r2v_fast_portrait_ultra_relaxed
- Update veo_3_0_r2v_fast_landscape model key to
veo_3_0_r2v_fast_ultra_relaxed
- Implement automatic ST (Session Token) refresh when AT refresh fails
- Add refresh_session_token method in BrowserCaptchaService to extract
__Secure-next-auth.session-token from browser cookies
- Enhance token_manager to automatically retry AT refresh after ST update
- Add validation for AT tokens to ensure they are actually working
- Update README to document AT/ST automatic refresh feature
- Improve error handling and logging for token refresh operations
- Add conditional ST refresh support only available in personal mode