mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-29 03:44:06 +08:00
dfa712d989
* feat: add AI image generation tool Port the legacy generate_image tool to the opencode-based CLI as a Kilo-owned tool gated by experimental.image_generation config flag. - New generate_image tool with prompt/path/image/model params - Routes through Kilo Gateway (zero-config) or BYO OpenRouter key - Supports text-to-image generation and image editing - Dynamic model discovery via GET /kilo/models/images endpoint - VS Code settings toggle + live model dropdown in Experimental tab - Writes image to disk and returns inline FilePart attachment - Fallback model catalog for offline resilience * refactor: change default image model to openrouter/auto * fix: address bot review feedback - Remove unused fetchKiloImageModels import in tool - Normalize jpg→jpeg MIME in parser, input image, and attachment - Replace mismatched extensions in ensureExtension (not just append) - Add assertExternalDirectoryEffect for output path traversal guard - Map unauthorized errors to 401 (not 400) in image models handler - Keep last known model list on fetch failure (don't overwrite with empty) - Fix tool description (remove false web search claim, fix grammar) - Remove duplicated provider resolver tests * fix: add retry for image models request to handle backend startup race * fix(image-generation): address kilo bot review comments - ensureExtension replaces mismatched image extensions instead of appending (photo.jpg + PNG -> photo.png, not photo.jpg.png) - Gateway /models/images normalizes errors to 400/401 matching every other gateway route (was leaking undeclared upstream statuses) - Add 401 response to openapi.json + SDK types for /kilo/models/images to match the gateway's errors(400, 401) declaration * fix(gateway): align /models/images error handling with other gateway routes * refactor: switch image generation to effect HttpClient * test: cover kilo models images endpoint in httpapi exercise scenarios * Exclude POST-only and parameterized API endpoints from link checker * Add ImageModelsProvider to agent manager context tree * chore(deps): bump @openrouter/ai-sdk-provider to 2.10.0 Switches imageModel() to OpenRouter's POST /api/v1/images endpoint for proper image usage/billing and image-specific params. * fix: address image generation PR review feedback - revert @openrouter/ai-sdk-provider 2.9.0->2.10.0 bump (image tool uses raw HTTP, not the SDK) - translate image generation settings strings across all locales - use central KILO_OPENROUTER_BASE instead of hardcoded URL fallback - remove completed plan file * chore: refresh source-links.md after URL refactor