Skip to content

feat: add AI image generation tool#11566

Closed
vkeerthivikram wants to merge 202 commits into
Kilo-Org:mainfrom
vkeerthivikram:feat/image-generation
Closed

feat: add AI image generation tool#11566
vkeerthivikram wants to merge 202 commits into
Kilo-Org:mainfrom
vkeerthivikram:feat/image-generation

Conversation

@vkeerthivikram

@vkeerthivikram vkeerthivikram commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #11565

What changed

Ports the legacy generate_image tool to the opencode-based CLI. The AI agent can now generate images from text prompts and edit existing images, saving results to disk with inline rendering in the chat.

Core tool (generate_image)

  • New Kilo-owned tool at packages/opencode/src/kilocode/tool/generate-image.ts with params prompt, path, image (optional, for editing), model (optional override).
  • Routes through the Kilo Gateway (zero-config for logged-in users) with BYO OpenRouter API key fallback (OPENROUTER_API_KEY).
  • Uses chat-completions with modalities: ["image", "text"] via the Kilo cloud OpenRouter passthrough.
  • Writes the image to disk and returns a FilePart attachment for inline rendering.
  • Input image editing reads raw bytes (not text-decoded) + assertExternalDirectoryEffect path guard.

Dynamic model discovery

  • New fetchKiloImageModels() in the gateway package — queries api.kilo.ai and filters for output_modalities.includes("image").
  • New GET /kilo/models/images endpoint in the opencode HttpApiGroup + handler.
  • Config key experimental.image_generation_model for the default model.
  • A hardcoded FALLBACK_IMAGE_MODELS list is kept for offline/error resilience.

VS Code extension

  • Image Generation toggle + conditional model dropdown in Settings → Experimental.
  • The dropdown fetches the live model list from the local kilo serve process via /kilo/models/images.
  • Full i18n across 20 locales.

Gating

  • experimental.image_generation config flag (off by default) — available on all clients (CLI, VS Code, desktop).

Why

The legacy Kilo extension had image generation. It was lost during the opencode migration. This restores feature parity with a key improvement: dynamic model discovery from the Kilo Gateway instead of a static hardcoded list.

Implementation choices

  • Dynamic fetch over hardcoded catalog: The legacy used a static IMAGE_GENERATION_MODELS array. We fetch live from api.kilo.ai so new image models appear automatically, with a fallback list for offline use.
  • Chat-completions with modalities over Images API: OpenRouter only supports image output via modalities: ["image", "text"] for these models; the legacy images_api path was Roo-specific and dropped.
  • Effect HttpApiGroup over gateway Hono routes: The VS Code extension talks to the local kilo serve process, which uses the opencode Effect HttpApiGroup for /kilo/* routes. The endpoint is registered there.
  • Default model openrouter/auto: Uses OpenRouter's Auto Router to automatically select the best image model, rather than hardcoding a single provider.

Testing evidence

  • cd packages/opencode && bun run typecheck — pass
  • cd packages/kilo-vscode && bun run typecheck — pass
  • cd packages/opencode && bun test ./test/kilocode/tool/generate-image.test.ts — 25 tests pass
  • cd packages/opencode && bun test ./test/kilocode/tool-registry-indexing.test.ts — pass
  • cd packages/opencode && bun test ./test/tool/registry.test.ts — pass
  • bun run script/check-opencode-annotations.ts --base origin/main — all shared upstream changes annotated
  • bun run script/extract-source-links.ts — source links updated
  • ./script/generate.ts — SDK regenerated with new endpoint

Manual verification

  • Model dropdown populates in VS Code (requires Kilo login)
  • End-to-end image generation succeeds (prompt → image file + inline render)
  • Image editing works (input image → transformed output)
  • BYO OpenRouter key path works with OPENROUTER_API_KEY
  • Tool does NOT appear when flag is off

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
Copilot AI review requested due to automatic review settings June 23, 2026 07:32
@kilo-code-bot

kilo-code-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/kilocode/server/httpapi/handlers/kilo-gateway.ts 529 /kilo/models/images now preserves 401, but it still maps network/schema/upstream HTTP failures to 400, so clients cannot distinguish bad input from gateway/service outages.
packages/kilo-vscode/webview-ui/src/context/image-models.tsx 26 The webview still requests image models immediately with no extensionDataReady/retry path, so an early request can fail before kilo serve is ready and leave the settings panel empty until reload.
packages/kilo-vscode/webview-ui/src/i18n/ar.ts 1292 The image-model description and placeholder remain hard-coded in English across the non-English locale batch, so the settings UI still regresses i18n coverage.

SUGGESTION

File Line Issue
packages/opencode/src/config/config.ts 393 New experimental.image_generation* config keys should be mirrored in the cloud repo schema to avoid false unknown property validation errors for $schema users.
Files Reviewed (5 files)
  • packages/kilo-vscode/src/KiloProvider.ts - 0 issues
  • packages/opencode/src/kilocode/server/httpapi/handlers/kilo-gateway.ts - 1 issue
  • packages/opencode/src/kilocode/tool/generate-image.ts - 0 issues
  • packages/opencode/src/kilocode/tool/generate-image.txt - 0 issues
  • packages/opencode/test/kilocode/tool/generate-image.test.ts - 0 issues

Fix these issues in Kilo Cloud

Previous Review Summaries (3 snapshots, latest commit 632d2aa)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 632d2aa)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/kilocode/server/httpapi/handlers/kilo-gateway.ts 529 /kilo/models/images now preserves 401, but it still maps network/schema/upstream HTTP failures to 400, so clients cannot distinguish bad input from gateway/service outages.
packages/kilo-vscode/webview-ui/src/context/image-models.tsx 26 The webview still requests image models immediately with no extensionDataReady/retry path, so an early request can fail before kilo serve is ready and leave the settings panel empty until reload.
packages/kilo-vscode/webview-ui/src/i18n/ar.ts 1292 The image-model description and placeholder remain hard-coded in English across the non-English locale batch, so the settings UI still regresses i18n coverage.

SUGGESTION

File Line Issue
packages/opencode/src/config/config.ts 393 New experimental.image_generation* config keys should be mirrored in the cloud repo schema to avoid false unknown property validation errors for $schema users.
Files Reviewed (5 files)
  • packages/kilo-vscode/src/KiloProvider.ts - 0 issues
  • packages/opencode/src/kilocode/server/httpapi/handlers/kilo-gateway.ts - 1 issue
  • packages/opencode/src/kilocode/tool/generate-image.ts - 0 issues
  • packages/opencode/src/kilocode/tool/generate-image.txt - 0 issues
  • packages/opencode/test/kilocode/tool/generate-image.test.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit 4d50881)

Status: 5 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/kilocode/server/httpapi/handlers/kilo-gateway.ts 528 /kilo/models/images collapses unauthorized and upstream failures into 400, so the HttpApi/SDK contract misclassifies auth and backend errors as bad requests.
packages/kilo-vscode/webview-ui/src/context/image-models.tsx 26 The webview requests image models immediately but has no extensionDataReady/retry path, so an early request can fail before kilo serve is ready and leave the settings panel empty until reload.
packages/kilo-vscode/src/KiloProvider.ts 2268 Image model fetch failures are converted into models: [], making auth or backend errors indistinguishable from a genuinely empty catalog in the settings UI.
packages/kilo-vscode/webview-ui/src/i18n/ar.ts 1292 The follow-up locale sweep still leaves the new image-model description and placeholder in English across the non-English locale files touched in this commit, so the settings UI continues to regress i18n coverage.

SUGGESTION

File Line Issue
packages/opencode/src/config/config.ts 393 New experimental.image_generation* config keys should be mirrored in the cloud repo schema to avoid false unknown property validation errors for $schema users.
Files Reviewed (22 files)
  • packages/kilo-vscode/webview-ui/src/i18n/ar.ts - 1 issue
  • packages/kilo-vscode/webview-ui/src/i18n/br.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/bs.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/da.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/de.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/en.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/es.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/fr.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/it.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ja.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ko.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/nl.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/no.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/pl.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ru.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/th.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/tr.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/uk.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/zh.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/zht.ts - 0 issues
  • packages/opencode/src/config/config.ts - 1 issue
  • packages/opencode/src/kilocode/tool/generate-image.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit baf12c7)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/kilocode/server/httpapi/handlers/kilo-gateway.ts 528 /kilo/models/images collapses unauthorized and upstream failures into 400, so the HttpApi/SDK contract misclassifies auth and backend errors as bad requests.
packages/kilo-vscode/webview-ui/src/context/image-models.tsx 26 The webview requests image models immediately but has no extensionDataReady/retry path, so an early request can fail before kilo serve is ready and leave the settings panel empty until reload.
packages/kilo-vscode/src/KiloProvider.ts 2268 Image model fetch failures are converted into models: [], making auth or backend errors indistinguishable from a genuinely empty catalog in the settings UI.

SUGGESTION

File Line Issue
packages/opencode/src/config/config.ts 393 New experimental.image_generation* config keys should be mirrored in the cloud repo schema to avoid false unknown property validation errors for $schema users.
Files Reviewed (54 files)
  • .changeset/image-generation.md - 0 issues
  • .kilo/plans/1782130204245-image-generation-tool.md - 0 issues
  • packages/kilo-docs/source-links.md - 0 issues
  • packages/kilo-gateway/src/api/models.ts - 0 issues
  • packages/kilo-gateway/src/index.ts - 0 issues
  • packages/kilo-gateway/src/server/routes.ts - 0 issues
  • packages/kilo-vscode/src/KiloProvider.ts - 1 issue
  • packages/kilo-vscode/src/image-generation/models.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/App.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/settings/ExperimentalTab.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/context/image-models.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/i18n/ar.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/br.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/bs.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/da.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/de.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/en.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/es.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/fr.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/it.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ja.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ko.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/nl.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/no.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/pl.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ru.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/th.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/tr.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/uk.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/zh.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/zht.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/types/messages/config.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/types/messages/extension-messages.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts - 0 issues
  • packages/opencode/src/config/config.ts - 1 issue
  • packages/opencode/src/kilocode/server/httpapi/groups/kilo-gateway.ts - 0 issues
  • packages/opencode/src/kilocode/server/httpapi/handlers/kilo-gateway.ts - 1 issue
  • packages/opencode/src/kilocode/tool/generate-image.ts - 0 issues
  • packages/opencode/src/kilocode/tool/generate-image.txt - 0 issues
  • packages/opencode/src/kilocode/tool/registry.ts - 0 issues
  • packages/opencode/src/tool/registry.ts - 0 issues
  • packages/opencode/test/kilocode/session-compaction-cap.test.ts - 0 issues
  • packages/opencode/test/kilocode/session-prompt-compaction-safety.test.ts - 0 issues
  • packages/opencode/test/kilocode/session-prompt-permission-refresh.test.ts - 0 issues
  • packages/opencode/test/kilocode/tool-registry-indexing-import-failure.test.ts - 0 issues
  • packages/opencode/test/kilocode/tool-registry-indexing.test.ts - 0 issues
  • packages/opencode/test/kilocode/tool-registry-semantic-import-failure.test.ts - 0 issues
  • packages/opencode/test/kilocode/tool/generate-image.test.ts - 0 issues
  • packages/opencode/test/session/prompt.test.ts - 0 issues
  • packages/opencode/test/session/snapshot-tool-race.test.ts - 0 issues
  • packages/opencode/test/tool/registry.test.ts - 0 issues
  • packages/sdk/js/src/v2/gen/sdk.gen.ts - 0 issues
  • packages/sdk/js/src/v2/gen/types.gen.ts - 0 issues
  • packages/sdk/openapi.json - 0 issues

Fix these issues in Kilo Cloud


Reviewed by gpt-5.4-20260305 · Input: 21.7K · Output: 1.1K · Cached: 7.2K

Review guidance: REVIEW.md from base branch main

Comment thread packages/opencode/src/kilocode/server/httpapi/handlers/kilo-gateway.ts Outdated
Comment thread packages/kilo-vscode/webview-ui/src/context/image-models.tsx Outdated
Comment thread packages/kilo-vscode/src/KiloProvider.ts Outdated
batch_tool: Schema.optional(Schema.Boolean).annotate({ description: "Enable the batch tool" }),
// kilocode_change start
codebase_search: Schema.optional(Schema.Boolean).annotate({ description: "Enable AI-powered codebase search" }),
image_generation: Schema.optional(Schema.Boolean).annotate({ description: "Enable AI image generation" }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Mirror these new config keys in the cloud schema

This PR adds new kilocode_change fields under Config.Info.experimental, and the repo guidance requires matching entries in the cloud repo at apps/web/src/app/config.json/extras.ts. If that companion schema update is missing, users validating against https://app.kilo.ai/config.json will get false unknown property errors for experimental.image_generation and experimental.image_generation_model.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports the legacy generate_image capability into the opencode-based CLI/serve surface, adding a gated image-generation tool plus a /kilo/models/images model-catalog endpoint and VS Code settings UI to toggle/select image models.

Changes:

  • Added generate_image Kilo tool (text-to-image + optional image-edit) with disk output and inline FilePart attachment.
  • Added dynamic image-model discovery via Kilo Gateway (fetchKiloImageModels() + GET /kilo/models/images) and regenerated SDK/OpenAPI artifacts.
  • Integrated VS Code settings toggle + model dropdown (webview message plumbing + context provider + locale string additions).

Reviewed changes

Copilot reviewed 54 out of 54 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
packages/sdk/openapi.json Regenerated OpenAPI spec including /kilo/models/images and new config keys.
packages/sdk/js/src/v2/gen/types.gen.ts Regenerated SDK types for new config keys and /kilo/models/images.
packages/sdk/js/src/v2/gen/sdk.gen.ts Regenerated SDK client with kilo.models.images() helper.
packages/opencode/test/tool/registry.test.ts Provides Auth.defaultLayer for tool registry tests.
packages/opencode/test/session/snapshot-tool-race.test.ts Adds Auth.defaultLayer for session/http test wiring.
packages/opencode/test/session/prompt.test.ts Adds Auth.defaultLayer for session prompt test wiring.
packages/opencode/test/kilocode/tool/generate-image.test.ts New unit tests for parser/provider/extension/model catalog.
packages/opencode/test/kilocode/tool-registry-semantic-import-failure.test.ts Extends registry test coverage for generate_image tool presence.
packages/opencode/test/kilocode/tool-registry-indexing.test.ts Ensures generate_image is gated by experimental.image_generation.
packages/opencode/test/kilocode/tool-registry-indexing-import-failure.test.ts Extends registry import-failure test for generate_image.
packages/opencode/test/kilocode/session-prompt-permission-refresh.test.ts Adds Auth.defaultLayer for permission refresh tests.
packages/opencode/test/kilocode/session-prompt-compaction-safety.test.ts Adds Auth.defaultLayer for compaction safety tests.
packages/opencode/test/kilocode/session-compaction-cap.test.ts Adds Auth.defaultLayer for compaction cap tests.
packages/opencode/src/tool/registry.ts Adds Auth.Service dependency/layer to support generate_image.
packages/opencode/src/kilocode/tool/registry.ts Registers GenerateImageTool and gates it behind experimental.image_generation.
packages/opencode/src/kilocode/tool/generate-image.txt Adds tool description text.
packages/opencode/src/kilocode/tool/generate-image.ts Implements generate_image tool logic (provider routing, request, parse, write, attach).
packages/opencode/src/kilocode/server/httpapi/handlers/kilo-gateway.ts Adds handler for listing image-capable models via gateway proxy.
packages/opencode/src/kilocode/server/httpapi/groups/kilo-gateway.ts Defines GET /kilo/models/images Effect HttpApi endpoint + schemas.
packages/opencode/src/config/config.ts Adds experimental.image_generation + experimental.image_generation_model config keys.
packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts Adds requestImageModels webview → extension message type.
packages/kilo-vscode/webview-ui/src/types/messages/extension-messages.ts Adds imageModelsLoaded extension → webview message type.
packages/kilo-vscode/webview-ui/src/types/messages/config.ts Adds image-generation fields to ExperimentalConfig.
packages/kilo-vscode/webview-ui/src/i18n/ar.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/br.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/bs.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/da.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/de.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/en.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/es.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/fr.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/it.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/ja.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/ko.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/nl.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/no.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/pl.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/ru.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/th.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/tr.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/uk.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/zh.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/i18n/zht.ts Adds settings strings for image-generation toggle/model UI.
packages/kilo-vscode/webview-ui/src/context/image-models.tsx Adds webview context/provider to request + store image model list.
packages/kilo-vscode/webview-ui/src/components/settings/ExperimentalTab.tsx Adds image-generation toggle and conditional model dropdown UI.
packages/kilo-vscode/webview-ui/src/App.tsx Wires ImageModelsProvider into the app provider tree.
packages/kilo-vscode/src/KiloProvider.ts Handles requestImageModels and posts imageModelsLoaded to webview.
packages/kilo-vscode/src/image-generation/models.ts Implements extension-side fetch to /kilo/models/images via local backend.
packages/kilo-gateway/src/server/routes.ts Adds gateway Hono routes for image model listing (and image generation proxy).
packages/kilo-gateway/src/index.ts Exports new fetchKiloImageModels types/helpers.
packages/kilo-gateway/src/api/models.ts Adds fetchKiloImageModels() and refactors shared raw model fetch.
packages/kilo-docs/source-links.md Updates extracted source links for new URLs/references.
.kilo/plans/1782130204245-image-generation-tool.md Adds implementation plan/status doc for the feature.
.changeset/image-generation.md Adds changeset entry for experimental image generation feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/opencode/src/kilocode/tool/generate-image.ts
Comment thread packages/opencode/src/kilocode/tool/generate-image.ts
Comment thread packages/opencode/src/kilocode/tool/generate-image.ts
Comment thread packages/opencode/src/kilocode/tool/generate-image.ts
Comment thread packages/opencode/src/kilocode/tool/generate-image.ts Outdated
Comment thread packages/opencode/src/kilocode/tool/generate-image.txt Outdated
Comment thread packages/kilo-vscode/src/KiloProvider.ts
Comment thread packages/opencode/test/kilocode/tool/generate-image.test.ts Outdated
Comment on lines +1343 to +1347
"settings.experimental.imageGeneration.title": "Image Generation",
"settings.experimental.imageGeneration.description": "Enable AI image generation",
"settings.experimental.imageGenerationModel.title": "Image Model",
"settings.experimental.imageGenerationModel.description": "Model to use for image generation (fetched from Kilo Gateway)",
"settings.experimental.imageGenerationModel.placeholder": "Default (Gemini 2.5 Flash Image)",
@vkeerthivikram vkeerthivikram force-pushed the feat/image-generation branch from 7e87d79 to 4d50881 Compare June 23, 2026 07:39
"settings.experimental.imageGeneration.title": "Image Generation",
"settings.experimental.imageGeneration.description": "Enable AI image generation",
"settings.experimental.imageGenerationModel.title": "Image Model",
"settings.experimental.imageGenerationModel.description": "Image Generation Model",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: The updated image-model setting copy is still hard-coded in English across this locale batch

ExperimentalTab renders both settings.experimental.imageGenerationModel.description and the adjacent placeholder directly in the settings row. Because this same replacement was applied across the other non-English locale files touched in this commit, users will still see untranslated image-generation settings text even after the follow-up i18n sweep.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

- 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

if (result.error) {
const err =
result.error.kind === "unauthorized" ? new HttpApiError.Unauthorized({}) : new HttpApiError.BadRequest({})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Upstream and network failures still collapse into 400

fetchKiloImageModels() already distinguishes network, schema, and http failures, but this branch still maps every non-unauthorized error to HttpApiError.BadRequest. That means a transient gateway outage or a 5xx response is surfaced to the SDK as a client-input problem, so callers cannot distinguish a bad request from a backend/service failure.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

vkeerthivikram and others added 19 commits June 23, 2026 13:27
# Conflicts:
#	packages/opencode/test/tool/registry.test.ts
# Conflicts:
#	packages/kilo-vscode/webview-ui/src/components/settings/ExperimentalTab.tsx
#	packages/kilo-vscode/webview-ui/src/i18n/it.ts
#	packages/kilo-vscode/webview-ui/src/types/messages/config.ts
#	packages/opencode/src/config/config.ts
#	packages/opencode/src/kilocode/tool/registry.ts
#	packages/opencode/test/kilocode/tool-registry-indexing-import-failure.test.ts
#	packages/opencode/test/kilocode/tool-registry-indexing.test.ts
#	packages/opencode/test/kilocode/tool-registry-semantic-import-failure.test.ts
#	packages/sdk/js/src/v2/gen/types.gen.ts
#	packages/sdk/openapi.json
…h-notification

feat(vscode): notify on matching marketplace items
# Conflicts:
#	packages/kilo-gateway/src/index.ts
…rktree-sandbox

feat(agent-manager): add sandbox toggle to new worktree modal
…ation

docs: document the experimental sandbox feature
# Conflicts:
#	packages/kilo-vscode/tests/unit/prompt-input-connection-guard.test.ts
#	packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
catrielmuller and others added 24 commits June 29, 2026 11:43
…e-docs

docs(kilo-docs): remove legacy IDE documentation
feat(cli): add background process lifetimes
# Conflicts:
#	bun.lock
#	packages/opencode/src/cli/cmd/run/footer.ts
#	packages/opencode/src/cli/cmd/run/footer.view.tsx
#	packages/opencode/src/cli/cmd/tui/context/sync.tsx
#	packages/opencode/src/kilocode/tool/registry.ts
#	packages/opencode/src/session/session.ts
#	packages/opencode/src/tool/shell.ts
#	packages/opencode/test/kilocode/task-nesting.test.ts
#	packages/opencode/test/kilocode/tool-registry-indexing.test.ts
#	packages/opencode/test/session/prompt.test.ts
…Kilo-Org#11788)

The branch icon read as a git merge glyph for the auto model entry.
Swap to the models sparkle icon, which conveys automatic/AI selection.
* feat(jetbrains): show profile balance details

* fix(jetbrains): address profile balance review feedback
feat(cli): interactive terminal tool
# Conflicts:
#	packages/kilo-vscode/webview-ui/src/App.tsx
#	packages/kilo-vscode/webview-ui/src/types/messages/config.ts
#	packages/opencode/src/config/config.ts
#	packages/opencode/src/kilocode/tool/registry.ts
#	packages/opencode/test/kilocode/tool-registry-indexing.test.ts
#	packages/sdk/js/src/v2/gen/types.gen.ts
#	packages/sdk/openapi.json
…able-error-output

feat(cli): surface resumable task_id when a subagent stops on error
The release publish smoke test demanded a live bubblewrap user-namespace bootstrap on the runner, which GitHub-hosted Ubuntu 24.04 blocks via kernel.apparmor_restrict_unprivileged_userns=1 (uid map permission denied). Make that host invocation non-fatal so the gate validates the artifact, not the runner's userns policy; the runtime probe already degrades gracefully when unprivileged user namespaces are unavailable.

The Alpine smoke block also had an unescaped single-quoted grep pattern inside an outer sh -c '...' string, which prematurely terminated the script so the NOTICE license grep ran with no file (empty stdin -> exit 1) and the rest of the script never ran. Escape the inner quotes as '\''...'\'' so the license check runs against the real file.
…n-locales

feat(vscode): localize autocomplete strings
…-test

fix(ci): stabilize Linux sandbox CLI release smoke test
feat(agent-manager): send inline review draft comments directly from diff
@vkeerthivikram vkeerthivikram force-pushed the feat/image-generation branch from 8c15d26 to 6541714 Compare June 30, 2026 09:11
@vkeerthivikram

Copy link
Copy Markdown
Contributor Author

Closing in favor of a fresh PR — rebasing the feature onto the latest main from a clean branch to drop merge-history noise. New PR will be linked shortly.

@vkeerthivikram

Copy link
Copy Markdown
Contributor Author

Reopened as a clean PR rebased onto the latest main: #11826 (branch feat/ai-image-generation). Same feature, no stale merge history.

NJ-2020 pushed a commit to NJ-2020/kilocode that referenced this pull request Jul 4, 2026
…rmatting (Kilo-Org#11566)

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support AI image generation (generate_image tool)