OpenCode v1.3.5 (#8806)

* tweak: use theme tokens for debug bar surface

* chore: update nix node_modules hashes

* feat(tui): add heap snapshot functionality for TUI and server (#19028)

* ci

* change model for changelog

* release: v1.3.2

* fix(opencode): skip typechecking generated models snapshot (#19018)

* Revert "fix(app): more startup efficiency (#18985)"

This reverts commit 98b3340cee.

* Revert "fix(app): startup efficiency (#18854)"

This reverts commit 546748a461.

* effectify Worktree service (#18679)

* fix: increase operations-per-run to 1000 and pin stale action to v10.2.0

The stale-issues workflow was hitting the default 30 operations limit,
preventing it from processing all 2900+ issues/PRs. Increased to 1000
to handle the full backlog. Also pinned to exact v10.2.0 for reproducibility.

* Add close-issues script and GitHub Action

- Create script/github/close-issues.ts to close stale issues after 60 days
- Add GitHub Action workflow to run daily at 2 AM
- Remove old stale-issues workflow to avoid conflicts

* Fix close-issues workflow permissions

- Add contents: read permission for checkout
- Use github.token instead of secrets.GITHUB_TOKEN

* Process issues sequentially to avoid rate limits

* Change issue close reason from not_planned to completed

* fix(opencode): avoid snapshotting files over 2MB (#19043)

* fix: provide merge context to beta conflict resolver (#19055)

* tweak: only spawn lsp servers for files in current instance (or cwd if instance is global) (#19058)

* fix: beta resolver typecheck + build smoke check (#19060)

* fix: unblock beta conflict recovery (#19068)

* electron: add createDirectory to open directory picker (#19071)

* electron: remove file extension from electron-store wrapper (#19082)

* app: pre-warm project globalSync state when navigate project via keybind (#19088)

* fix(app): move message navigation off cmd+arrow (#18728)

* Reapply "fix(app): startup efficiency (#18854)"

This reverts commit a379eb3867.

* Reapply "fix(app): more startup efficiency (#18985)"

This reverts commit cbe1337f24.

* fix(app): hash inline script for csp

* Revert "fix(app): startup efficiency"

* Reapply "fix(app): startup efficiency"

This reverts commit 898456a25c.

* fix(app): opencode web server url

* chore(app): markdown playground in storyboard

* chore(app): markdown playground in storyboard

* feat(core): initial implementation of syncing (#17814)

* chore: generate

* chore: bump modelcontextprotocol/sdk to 1.27.1 (#19064)

* chore: storybook tweaks

* feat: restore git-backed review modes with effectful git service (#18900)

* chore: generate

* chore: update nix node_modules hashes

* chore: cleanup

* chore: remove dead code for todoread tool (#19128)

* chore: storybook tweaks

* fix(opencode): classify ZlibError from Bun fetch as retryable instead of unknown (#19104)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>

* fix(task): respect agent permission config for todowrite tool (#19125)

* fix(app): agent normalization (#19169)

* fix: Windows e2e stability (CrossSpawnSpawner, snapshot isolation, session race guards) (#19163)

* fix+refactor(mcp): lifecycle tests, cancelPending fix, Effect migration (#19042)

* effectify Bus service: migrate to Effect PubSub + InstanceState (#18579)

* file: use Effect.cached for scan deduplication (#19164)

* ignore: update disavowed list (#19184)

* skill: use Effect.cached for load deduplication (#19165)

* chore: generate

* fix: bump gitlab-ai-provider to 5.3.3 for DWS tool approval support (#19185)

* test: restore 5 workers on Windows e2e (#19188)

* fix(opencode): image paste on Windows Terminal 1.25+ with kitty keyboard (#17674)

* chore: update nix node_modules hashes

* wip: zen

* wip: zen

* go: do not respect disabled zen models

* fix: ensure enterprise url is set properly during auth flow (#19212)

* revert: roll back git-backed review modes (#19295)

* chore: generate

* tui: bypass local SSE event streaming in worker (#19183)

* feat: embed WebUI in binary with proxy flags (#19299)

Co-authored-by: BlankParticle <blankparticle@gmail.com>

* release: v1.3.3

* chore: generate

* changelog ci tweaks

* refactor(lsp): effectify LSP service with InstanceState (#19150)

* chore: generate

* feat: add gpt prompt so non codex gpt models have their own system prompt modeled after codex cli (#19220)

* feat(core): remove workspace server, WorkspaceContext, start work towards better routing (#19316)

* effectify Config service (#19139)

* chore: generate

* refactor(config): use cachedInvalidateWithTTL, bump effect to beta.37 (#19322)

* fix(mcp): close transport on failed/timed-out connections (#19200)

* fix(app): more startup perf (#19288)

* chore: generate

* chore: update nix node_modules hashes

* fix(app): don't bundle fonts (#19329)

* chore: generate

* fix(app): default shell tool to collapsed

* fix(app): remove fork session button

* fix(ui): reduce markdown jank while responses stream (#19304)

* fix: web ui bundle build on windows (#19337)

* refactor(effect): yield services instead of promise facades (#19325)

* chore: generate

* refactor(vcs): replace async git() with ChildProcessSpawner (#19361)

* fix(opencode): ignore generated models snapshot files (#19362)

* fix(ui): keep partial markdown readable while responses stream (#19403)

* chore: update nix node_modules hashes

* fix(app): persist queued followups across project switches (#19421)

* refactor(tool-registry): yield Config/Plugin services, use Effect.forEach (#19363)

* chore: generate

* tui plugins (#19347)

* chore: generate

* effectify Skill service internals (#19364)

* chore: update nix node_modules hashes

* effectify Plugin service internals (#19365)

* refactor(core): split out instance and route through workspaces (#19335)

* chore(app): more spacing controls

* fix(ui): make streamed markdown feel more continuous (#19404)

* fix(app): resize layout viewport when mobile keyboard appears (#15841)

* fix(desktop-electron): match dev dock icon inset on macOS (#19429)

* fix(app): default file tree to closed with minimum width (#19426)

* fix flaky plugin tests (no mock.module for bun) (#19445)

* tweak: add additional overflow error patterns (#19446)

* no theme override in dev (#19456)

* feat: AI SDK v6 support (#18433)

* refactor(session): effectify Session service (#19449)

* refactor(core): move more responsibility to workspace routing (#19455)

* chore: update nix node_modules hashes

* refactor(format): use ChildProcessSpawner instead of Process.spawn (#19457)

* chore: generate

* Single target plugin entrypoints (#19467)

* refactor(session): effectify SessionCompaction service (#19459)

* feat(ci): use Azure Artifact Signing for Windows releases (#15201)

* fix(app): more startup efficiency (#19454)

* update effect to 4.0.0-beta.42 (#19484)

* chore: update nix node_modules hashes

* tweak: adjust bash tool description to increase cache hit rates between projects (#19487)

* refactor(session): move context into prompt footer (#19486)

* refactor(prompt): remove variant cycle display from footer (#19489)

* feat: add model variant selection dialog (#19488)

* fix: restore subagent footer and fix style guide violations (#19491)

* tweak(session): add top spacing and remove obsolete docs prompt

* upgrade opentui to 0.1.91 (#19440)

* refactor(file): use AppFileSystem instead of raw Filesystem (#19458)

* chore: generate

* chore: update nix node_modules hashes

* kv theme before default fallback (#19523)

* feat: open dialog for model variant selection instead of cycling (#19534)

* refactor(session): effectify session processor (#19485)

* feat: dialog variant menu and subagent improvements (#19537)

* use theme color for prompt placeholder (#19535)

* fix: update opencode-gitlab-auth to 2.0.1 (#19552)

* chore: update nix node_modules hashes

* prompt slot (#19563)

* fix: respect semver build identifiers for nix (#11915)

* fix: nix embedded web-ui support (#19561)

* ignore: kill todo (#19566)

* chore: update nix node_modules hashes

* wip: zen

* wip: zen

* zen: ZDR policy

* ci: cancel stale nix-hashes runs (#19571)

* release: v1.3.4

* tweak: adjust gpt prompt to be more minimal, fix file reference annoyances (#19585)

* core: fix plugin hooks to properly handle async operations ensuring plugins can execute async code without errors (#19586)

* release: v1.3.5

* refactor: kilo compat for v1.3.5

* fix: Fix typecheck issues

* style(kilo-vscode): adjust formatting in parts-util and PopupSelector

Reindent boolean expression in isCompletionResult to remove extra
indentation, and reformat PopupSelectorProps generic interface
extends clause across multiple lines.

---------

Co-authored-by: Jay V <air@live.ca>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: Dax <mail@thdxr.com>
Co-authored-by: Dax Raad <d@ironbay.co>
Co-authored-by: opencode <opencode@sst.dev>
Co-authored-by: Kit Langton <kit.langton@gmail.com>
Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com>
Co-authored-by: Luke Parker <10430890+Hona@users.noreply.github.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: Brendan Allan <brendonovich@outlook.com>
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
Co-authored-by: James Long <longster@gmail.com>
Co-authored-by: André Cruz <acruz@cloudflare.com>
Co-authored-by: Ariane Emory <97994360+ariane-emory@users.noreply.github.com>
Co-authored-by: Vladimir Glafirov <vglafirov@gitlab.com>
Co-authored-by: Frank <frank@anoma.ly>
Co-authored-by: BlankParticle <blankparticle@gmail.com>
Co-authored-by: Sebastian <hasta84@gmail.com>
Co-authored-by: Burak Yigit Kaya <byk@sentry.io>
Co-authored-by: Caleb Norton <n0603919@outlook.com>
Co-authored-by: Imanol Maiztegui <imanol.mzd@gmail.com>
This commit is contained in:
Johnny Eric Amancio
2026-04-12 17:10:08 +02:00
committed by GitHub
parent 608afd3e79
commit 6cf72ef05c
39 changed files with 151 additions and 221 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ if (!(root instanceof HTMLElement) && import.meta.env.DEV) {
const getCurrentUrl = () => {
if (location.hostname.includes("opencode.ai")) return "http://localhost:4096"
if (import.meta.env.DEV)
return `http://${import.meta.env.VITE_OPENCODE_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_OPENCODE_SERVER_PORT ?? "4096"}`
return `http://${import.meta.env.VITE_KILO_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_KILO_SERVER_PORT ?? "4096"}`
return location.origin
}
@@ -21,7 +21,7 @@ async function signWindows(configuration: { path: string }) {
}
const channel = (() => {
const raw = process.env.OPENCODE_CHANNEL
const raw = process.env.KILO_CHANNEL
if (raw === "dev" || raw === "beta" || raw === "prod") return raw
return "dev"
})()
@@ -2,7 +2,7 @@ import { defineConfig } from "electron-vite"
import appPlugin from "@opencode-ai/app/vite"
const channel = (() => {
const raw = process.env.OPENCODE_CHANNEL
const raw = process.env.KILO_CHANNEL
if (raw === "dev" || raw === "beta" || raw === "prod") return raw
return "dev"
})()
@@ -10,7 +10,7 @@ const channel = (() => {
export default defineConfig({
main: {
define: {
"import.meta.env.OPENCODE_CHANNEL": JSON.stringify(channel),
"import.meta.env.KILO_CHANNEL": JSON.stringify(channel),
},
build: {
rollupOptions: {
@@ -9,8 +9,8 @@ if (!dir) throw new Error("LATEST_YML_DIR is required")
const repo = process.env.GH_REPO
if (!repo) throw new Error("GH_REPO is required")
const version = process.env.OPENCODE_VERSION
if (!version) throw new Error("OPENCODE_VERSION is required")
const version = process.env.KILO_VERSION
if (!version) throw new Error("KILO_VERSION is required")
type FileEntry = {
url: string
+1 -1
View File
@@ -2,7 +2,7 @@ import { $ } from "bun"
import { copyBinaryToSidecarFolder, getCurrentSidecar, windowsify } from "./utils"
await $`bun ./scripts/copy-icons.ts ${process.env.OPENCODE_CHANNEL ?? "dev"}`
await $`bun ./scripts/copy-icons.ts ${process.env.KILO_CHANNEL ?? "dev"}`
const RUST_TARGET = Bun.env.RUST_TARGET
+1 -1
View File
@@ -13,7 +13,7 @@ await Bun.write("./package.json", JSON.stringify(pkg, null, 2) + "\n")
console.log(`Updated package.json version to ${Script.version}`)
const sidecarConfig = getCurrentSidecar()
const artifact = process.env.OPENCODE_CLI_ARTIFACT ?? "opencode-cli"
const artifact = process.env.KILO_CLI_ARTIFACT ?? "kilo-cli" // kilocode_change
const dir = "resources/opencode-binaries"
+1 -1
View File
@@ -3,7 +3,7 @@ import { $ } from "bun"
export type Channel = "dev" | "beta" | "prod"
export function resolveChannel(): Channel {
const raw = Bun.env.OPENCODE_CHANNEL
const raw = Bun.env.KILO_CHANNEL
if (raw === "dev" || raw === "beta" || raw === "prod") return raw
return "dev"
}
+5 -5
View File
@@ -123,8 +123,8 @@ export function syncCli() {
export function serve(hostname: string, port: number, password: string) {
const args = `--print-logs --log-level WARN serve --hostname ${hostname} --port ${port}`
const env = {
OPENCODE_SERVER_USERNAME: "opencode",
OPENCODE_SERVER_PASSWORD: password,
KILO_SERVER_USERNAME: "opencode",
KILO_SERVER_PASSWORD: password,
}
return spawnCommand(args, env)
@@ -137,9 +137,9 @@ export function spawnCommand(args: string, extraEnv: Record<string, string>) {
)
const envs = {
...base,
OPENCODE_EXPERIMENTAL_ICON_DISCOVERY: "true",
OPENCODE_EXPERIMENTAL_FILEWATCHER: "true",
OPENCODE_CLIENT: "desktop",
KILO_EXPERIMENTAL_ICON_DISCOVERY: "true",
KILO_EXPERIMENTAL_FILEWATCHER: "true",
KILO_CLIENT: "desktop",
XDG_STATE_HOME: app.getPath("userData"),
...extraEnv,
}
@@ -1,7 +1,7 @@
import { app } from "electron"
type Channel = "dev" | "beta" | "prod"
const raw = import.meta.env.OPENCODE_CHANNEL
const raw = import.meta.env.KILO_CHANNEL
export const CHANNEL: Channel = raw === "dev" || raw === "beta" || raw === "prod" ? raw : "dev"
export const SETTINGS_STORE = "opencode.settings"
+1 -1
View File
@@ -1,5 +1,5 @@
interface ImportMetaEnv {
readonly OPENCODE_CHANNEL: string
readonly KILO_CHANNEL: string
}
interface ImportMeta {
+2 -2
View File
@@ -277,7 +277,7 @@ function ensureLoopbackNoProxy() {
}
async function getSidecarPort() {
const fromEnv = process.env.OPENCODE_PORT
const fromEnv = process.env.KILO_PORT
if (fromEnv) {
const parsed = Number.parseInt(fromEnv, 10)
if (!Number.isNaN(parsed)) return parsed
@@ -302,7 +302,7 @@ async function getSidecarPort() {
function sqliteFileExists() {
const xdg = process.env.XDG_DATA_HOME
const base = xdg && xdg.length > 0 ? xdg : join(homedir(), ".local", "share")
return existsSync(join(base, "opencode", "opencode.db"))
return existsSync(join(base, "opencode", "kilo.db"))
}
function setupAutoUpdater() {
@@ -146,7 +146,7 @@ function injectGlobals(win: BrowserWindow, globals: Globals) {
deepLinks: Array.isArray(deepLinks) ? deepLinks.splice(0) : deepLinks,
}
void win.webContents.executeJavaScript(
`window.__OPENCODE__ = Object.assign(window.__OPENCODE__ ?? {}, ${JSON.stringify(data)})`,
`window.__KILO__ = Object.assign(window.__KILO__ ?? {}, ${JSON.stringify(data)})`,
)
})
}
@@ -36,14 +36,14 @@ const deepLinkEvent = "opencode:deep-link"
const emitDeepLinks = (urls: string[]) => {
if (urls.length === 0) return
window.__OPENCODE__ ??= {}
const pending = window.__OPENCODE__.deepLinks ?? []
window.__OPENCODE__.deepLinks = [...pending, ...urls]
window.__KILO__ ??= {}
const pending = window.__KILO__.deepLinks ?? []
window.__KILO__.deepLinks = [...pending, ...urls]
window.dispatchEvent(new CustomEvent(deepLinkEvent, { detail: { urls } }))
}
const listenForDeepLinks = () => {
const startUrls = window.__OPENCODE__?.deepLinks ?? []
const startUrls = window.__KILO__?.deepLinks ?? []
if (startUrls.length) emitDeepLinks(startUrls)
return window.api.onDeepLink((urls) => emitDeepLinks(urls))
}
@@ -58,12 +58,12 @@ const createPlatform = (): Platform => {
})()
const wslHome = async () => {
if (os !== "windows" || !window.__OPENCODE__?.wsl) return undefined
if (os !== "windows" || !window.__KILO__?.wsl) return undefined
return window.api.wslPath("~", "windows").catch(() => undefined)
}
const handleWslPicker = async <T extends string | string[]>(result: T | null): Promise<T | null> => {
if (!result || !window.__OPENCODE__?.wsl) return result
if (!result || !window.__KILO__?.wsl) return result
if (Array.isArray(result)) {
return Promise.all(result.map((path) => window.api.wslPath(path, "linux").catch(() => path))) as any
}
@@ -137,7 +137,7 @@ const createPlatform = (): Platform => {
if (os === "windows") {
const resolvedApp = app ? await window.api.resolveAppPath(app).catch(() => null) : null
const resolvedPath = await (async () => {
if (window.__OPENCODE__?.wsl) {
if (window.__KILO__?.wsl) {
const converted = await window.api.wslPath(path, "windows").catch(() => null)
if (converted) return converted
}
@@ -197,7 +197,7 @@ const createPlatform = (): Platform => {
getWslEnabled: async () => {
const next = await window.api.getWslConfig().catch(() => null)
if (next) return next.enabled
return window.__OPENCODE__!.wsl ?? false
return window.__KILO__!.wsl ?? false
},
setWslEnabled: async (enabled) => {
@@ -1,6 +1,6 @@
import { initI18n, t } from "./i18n"
export const UPDATER_ENABLED = () => window.__OPENCODE__?.updaterEnabled ?? false
export const UPDATER_ENABLED = () => window.__KILO__?.updaterEnabled ?? false
export async function runUpdater({ alertOnFail }: { alertOnFail: boolean }) {
await initI18n()
@@ -17,11 +17,11 @@ import { parseArgs } from "node:util"
const repo = process.env.GH_REPO
if (!repo) throw new Error("GH_REPO is required")
const releaseId = process.env.OPENCODE_RELEASE
if (!releaseId) throw new Error("OPENCODE_RELEASE is required")
const releaseId = process.env.KILO_RELEASE
if (!releaseId) throw new Error("KILO_RELEASE is required")
const version = process.env.OPENCODE_VERSION
if (!releaseId) throw new Error("OPENCODE_VERSION is required")
const version = process.env.KILO_VERSION
if (!releaseId) throw new Error("KILO_VERSION is required")
const token = process.env.GH_TOKEN ?? process.env.GITHUB_TOKEN
if (!token) throw new Error("GH_TOKEN or GITHUB_TOKEN is required")
+1 -1
View File
@@ -10,7 +10,7 @@ await Bun.write("./package.json", JSON.stringify(pkg, null, 2) + "\n")
console.log(`Updated package.json version to ${Script.version}`)
const sidecarConfig = getCurrentSidecar()
const artifact = process.env.OPENCODE_CLI_ARTIFACT ?? "opencode-cli"
const artifact = process.env.KILO_CLI_ARTIFACT ?? "kilo-cli"
const dir = "src-tauri/target/kilo-binaries"
+6 -6
View File
@@ -1,7 +1,7 @@
id = "kilo"
name = "Kilo"
description = "The open source coding agent."
version = "1.3.4"
version = "1.3.5"
schema_version = 1
authors = ["Anomaly"]
repository = "https://github.com/Kilo-Org/kilocode"
@@ -11,26 +11,26 @@ name = "Kilo"
icon = "./icons/opencode.svg"
[agent_servers.opencode.targets.darwin-aarch64]
archive = "https://github.com/Kilo-Org/kilocode/releases/download/v1.3.4/opencode-darwin-arm64.zip"
archive = "https://github.com/Kilo-Org/kilocode/releases/download/v1.3.5/opencode-darwin-arm64.zip"
cmd = "./opencode"
args = ["acp"]
[agent_servers.opencode.targets.darwin-x86_64]
archive = "https://github.com/Kilo-Org/kilocode/releases/download/v1.3.4/opencode-darwin-x64.zip"
archive = "https://github.com/Kilo-Org/kilocode/releases/download/v1.3.5/opencode-darwin-x64.zip"
cmd = "./opencode"
args = ["acp"]
[agent_servers.opencode.targets.linux-aarch64]
archive = "https://github.com/Kilo-Org/kilocode/releases/download/v1.3.4/opencode-linux-arm64.tar.gz"
archive = "https://github.com/Kilo-Org/kilocode/releases/download/v1.3.5/opencode-linux-arm64.tar.gz"
cmd = "./opencode"
args = ["acp"]
[agent_servers.opencode.targets.linux-x86_64]
archive = "https://github.com/Kilo-Org/kilocode/releases/download/v1.3.4/opencode-linux-x64.tar.gz"
archive = "https://github.com/Kilo-Org/kilocode/releases/download/v1.3.5/opencode-linux-x64.tar.gz"
cmd = "./opencode"
args = ["acp"]
[agent_servers.opencode.targets.windows-x86_64]
archive = "https://github.com/Kilo-Org/kilocode/releases/download/v1.3.4/opencode-windows-x64.zip"
archive = "https://github.com/Kilo-Org/kilocode/releases/download/v1.3.5/opencode-windows-x64.zip"
cmd = "./opencode.exe"
args = ["acp"]
@@ -22,5 +22,6 @@
| `kilo remote` | enable remote connection for real-time session relay |
| `kilo db` | database tools |
| `kilo config` | configuration tools |
| `kilo plugin <module>` | install plugin and update config |
| `kilo help [command]` | show full CLI reference |
| `kilo completion` | generate shell completion script |
@@ -825,6 +825,21 @@ Options:
--version Show version number [boolean]
```
## kilo plugin
```
install plugin and update config
Positionals:
module npm module name [string]
Options:
--help Show help [boolean]
--version Show version number [boolean]
-g, --global install in global config [boolean] [default: false]
-f, --force replace existing plugin version [boolean] [default: false]
```
## kilo help
```
+2 -2
View File
@@ -148,7 +148,7 @@ npm plugins can declare a version compatibility range in `package.json` using th
- There is no uninstall, list, or update CLI command for external plugins.
- Local file plugins are configured directly in `tui.json`.
When `plugin` entries exist in a writable `.opencode` dir or `OPENCODE_CONFIG_DIR`, OpenCode installs `@kilocode/plugin` into that dir and writes:
When `plugin` entries exist in a writable `.opencode` dir or `KILO_CONFIG_DIR`, OpenCode installs `@kilocode/plugin` into that dir and writes:
- `package.json`
- `bun.lock`
@@ -330,7 +330,7 @@ Metadata is persisted by plugin id.
- Internal TUI plugins load first.
- External TUI plugins load from `tuiConfig.plugin`.
- `--pure` / `OPENCODE_PURE` skips external TUI plugins only.
- `--pure` / `KILO_PURE` skips external TUI plugins only.
- External plugin resolution and import are parallel.
- External plugin activation is sequential to keep command, route, and side-effect order deterministic.
- File plugins that fail initially are retried once after waiting for config dependency installation.
+1 -1
View File
@@ -49,7 +49,7 @@ opencode acp --cwd /path/to/project
ACP excludes `QuestionTool` by default.
```bash
OPENCODE_ENABLE_QUESTION_TOOL=1 opencode acp
KILO_ENABLE_QUESTION_TOOL=1 opencode acp
```
Enable this only for ACP clients that support interactive question prompts.
@@ -1,3 +1,4 @@
// kilocode_change - retained; upstream moved session header into prompt footer in #19486, Kilo keeps the dedicated header UI
import { type Accessor, createMemo, createSignal, Match, Show, Switch } from "solid-js"
import { useRouteData } from "@tui/context/route"
import { useSync } from "@tui/context/sync"
@@ -1,3 +1,4 @@
// kilocode_change - retained; upstream removed workspace-server subsystem in #19316, routing refactor incomplete in v1.3.5
import { Context } from "../util/context"
import type { WorkspaceID } from "./schema"
@@ -1,3 +1,4 @@
// kilocode_change - retained; upstream removed workspace-server subsystem in #19316, routing refactor incomplete in v1.3.5
import type { MiddlewareHandler } from "hono"
import { Flag } from "../flag/flag"
import { getAdaptor } from "./adaptors"
@@ -1,3 +1,4 @@
// kilocode_change - retained; upstream removed workspace-server subsystem in #19316, routing refactor incomplete in v1.3.5
import { GlobalBus } from "../../bus/global"
import { Hono } from "hono"
import { streamSSE } from "hono/streaming"
@@ -1,3 +1,4 @@
// kilocode_change - retained; upstream removed workspace-server subsystem in #19316, routing refactor incomplete in v1.3.5
import { Hono } from "hono"
import { Instance } from "../../project/instance"
import { InstanceBootstrap } from "../../project/bootstrap"
+1 -1
View File
@@ -300,7 +300,7 @@ export namespace Plugin {
for (const hook of state.hooks) {
const fn = hook[name] as any
if (!fn) continue
yield* Effect.promise(() => fn(input, output))
yield* Effect.promise(async () => fn(input, output))
}
return output
})
+2
View File
@@ -260,7 +260,9 @@ export namespace Project {
time: { created: Date.now(), updated: Date.now() },
}
// kilocode_change start
if (Flag.KILO_EXPERIMENTAL_ICON_DISCOVERY) yield* discover(existing).pipe(Effect.ignore, Effect.forkIn(scope))
// kilocode_change end
const result: Info = {
...existing,
@@ -31,6 +31,13 @@ interface FetchDecompressionError extends Error {
path: string
}
/** Error shape thrown by Bun's fetch() when gzip/br decompression fails mid-stream */
interface FetchDecompressionError extends Error {
code: "ZlibError"
errno: number
path: string
}
export namespace MessageV2 {
export function isMedia(mime: string) {
return mime.startsWith("image/") || mime === "application/pdf"
+61 -70
View File
@@ -1,28 +1,25 @@
You are OpenCode, You and the user share the same workspace and collaborate to achieve the user's goals.
You are Kilo Code, You and the user share the same workspace and collaborate to achieve the user's goals.
You are a deeply pragmatic, effective software engineer. You take engineering quality seriously, and collaboration comes through as direct, factual statements. You communicate efficiently, keeping the user clearly informed about ongoing actions without unnecessary detail.
## Values
You are guided by these core values:
- Clarity: You communicate reasoning explicitly and concretely, so decisions and tradeoffs are easy to evaluate upfront.
- Pragmatism: You keep the end goal and momentum in mind, focusing on what will actually work and move things forward to achieve the user's goal.
- Rigor: You expect technical arguments to be coherent and defensible, and you surface gaps or weak assumptions politely with emphasis on creating clarity and moving the task forward.
## Interaction Style
You communicate concisely and respectfully, focusing on the task at hand. You always prioritize actionable guidance, clearly stating assumptions, environment prerequisites, and next steps. Unless explicitly asked, you avoid excessively verbose explanations about your work.
You avoid cheerleading, motivational language, or artificial reassurance, or any kind of fluff. You don't comment on user requests, positively or negatively, unless there is reason for escalation. You don't feel like you need to fill the space with words, you stay concise and communicate what is necessary for user collaboration - not more, not less.
## Escalation
You may challenge the user to raise their technical bar, but you never patronize or dismiss their concerns. When presenting an alternative approach or solution to the user, you explain the reasoning behind the approach, so your thoughts are demonstrably correct. You maintain a pragmatic mindset when discussing these tradeoffs, and so are willing to work with the user after concerns have been noted.
# General
As an expert coding agent, your primary focus is writing code, answering questions, and helping the user complete their task in the current environment. You build context by examining the codebase first without making assumptions or jumping to conclusions. You think through the nuances of the code you encounter, and embody the mentality of a skilled senior software engineer.
You are a deeply pragmatic, effective software engineer. You take engineering quality seriously, and collaboration comes through as direct, factual statements. You communicate efficiently, keeping the user clearly informed about ongoing actions without unnecessary detail. You build context by examining the codebase first without making assumptions or jumping to conclusions. You think through the nuances of the code you encounter, and embody the mentality of a skilled senior software engineer.
- When searching for text or files, prefer using Glob and Grep tools (they are powered by `rg`)
- Parallelize tool calls whenever possible - especially file reads. Use `multi_tool_use.parallel` to parallelize tool calls and only this. Never chain together bash commands with separators like `echo "====";` as this renders to the user poorly.
## Editing Approach
- The best changes are often the smallest correct changes.
- When you are weighing two correct approaches, prefer the more minimal one (less new names, helpers, tests, etc).
- Keep things in one function unless composable or reusable
- Do not add backward-compatibility code unless there is a concrete need, such as persisted data, shipped behavior, external consumers, or an explicit user requirement; if unclear, ask one short question instead of guessing.
## Autonomy and persistence
Unless the user explicitly asks for a plan, asks a question about the code, is brainstorming potential solutions, or some other intent that makes it clear that code should not be written, assume the user wants you to make code changes or run tools to solve the user's problem. In these cases, it's bad to output your proposed solution in a message, you should go ahead and actually implement the change. If you encounter challenges or blockers, you should attempt to resolve them yourself.
Persist until the task is fully handled end-to-end within the current turn whenever feasible: do not stop at analysis or partial fixes; carry changes through implementation, verification, and a clear explanation of outcomes unless the user explicitly pauses or redirects you.
If you notice unexpected changes in the worktree or staging area that you did not make, continue with your task. NEVER revert, undo, or modify changes you did not make unless the user explicitly asks you to. There can be multiple agents or the user working in the same codebase concurrently.
## Editing constraints
- Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.
@@ -41,13 +38,11 @@ As an expert coding agent, your primary focus is writing code, answering questio
## Special user requests
- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as `date`), you should do so.
- If the user asks for a "review", default to a code review mindset: prioritise identifying bugs, risks, behavioural regressions, and missing tests. Findings must be the primary focus of the response - keep summaries or overviews brief and only after enumerating the issues. Present findings first (ordered by severity with file/line references), follow with open questions or assumptions, and offer a change-summary only as a secondary detail. If no findings are discovered, state that explicitly and mention any residual risks or testing gaps.
If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as `date`), you should do so.
## Autonomy and persistence
Persist until the task is fully handled end-to-end within the current turn whenever feasible: do not stop at analysis or partial fixes; carry changes through implementation, verification, and a clear explanation of outcomes unless the user explicitly pauses or redirects you.
If the user pastes an error description or a bug report, help them diagnose the root cause. You can try to reproduce it if it seems feasible with the available tools and skills.
Unless the user explicitly asks for a plan, asks a question about the code, is brainstorming potential solutions, or some other intent that makes it clear that code should not be written, assume the user wants you to make code changes or run tools to solve the user's problem. In these cases, it's bad to output your proposed solution in a message, you should go ahead and actually implement the change. If you encounter challenges or blockers, you should attempt to resolve them yourself.
If the user asks for a "review", default to a code review mindset: prioritise identifying bugs, risks, behavioural regressions, and missing tests. Findings must be the primary focus of the response - keep summaries or overviews brief and only after enumerating the issues. Present findings first (ordered by severity with file/line references), follow with open questions or assumptions, and offer a change-summary only as a secondary detail. If no findings are discovered, state that explicitly and mention any residual risks or testing gaps.
## Frontend tasks
@@ -60,57 +55,53 @@ Exception: If working within an existing website or design system, preserve the
# Working with the user
You interact with the user through a terminal. You have 2 ways of communicating with the users:
- Share intermediary updates in `commentary` channel.
- After you have completed all your work, send a message to the `final` channel.
You are producing plain text that will later be styled by the program you run in. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value. Follow the formatting rules exactly.
## General
Do not begin responses with conversational interjections or meta commentary. Avoid openers such as acknowledgements ("Done —", "Got it", "Great question, ") or framing phrases.
Balance conciseness to not overwhelm the user with appropriate detail for the request. Do not narrate abstractly; explain what you are doing and why.
Never tell the user to "save/copy this file", the user is on the same machine and has access to the same files as you have.
## Formatting rules
- You may format with GitHub-flavored Markdown.
- Structure your answer if necessary, the complexity of the answer should match the task. If the task is simple, your answer should be a one-liner. Order sections from general to specific to supporting.
- Never use nested bullets. Keep lists flat (single level). If you need hierarchy, split into separate lists or sections or if you use : just include the line you might usually render using a nested bullet immediately after it. For numbered lists, only use the `1. 2. 3.` style markers (with a period), never `1)`.
- Headers are optional, only use them when you think they are necessary. If you do use them, use short Title Case (1-3 words) wrapped in **…**. Don't add a blank line.
- Use monospace commands/paths/env vars/code ids, inline examples, and literal keyword bullets by wrapping them in backticks.
- Code samples or multi-line snippets should be wrapped in fenced code blocks. Include an info string as often as possible.
- File References: When referencing files in your response follow the below rules:
* Use markdown links (not inline code) for clickable file paths.
* Each reference should have a stand alone path. Even if it's the same file.
* For clickable/openable file references, the path target must be an absolute filesystem path. Labels may be short (for example, `[app.ts](/abs/path/app.ts)`).
* Optionally include line/column (1based): :line[:column] or #Lline[Ccolumn] (column defaults to 1).
* Do not use URIs like file://, vscode://, or https://.
* Do not provide range of lines
- Dont use emojis or em dashes unless explicitly instructed.
Your responses are rendered as GitHub-flavored Markdown.
## Final answer instructions
Never use nested bullets. Keep lists flat (single level). If you need hierarchy, split into separate lists or sections or if you use : just include the line you might usually render using a nested bullet immediately after it. For numbered lists, only use the `1. 2. 3.` style markers (with a period), never `1)`.
Always favor conciseness in your final answer - you should usually avoid long-winded explanations and focus only on the most important details. For casual chit-chat, just chat. For simple or single-file tasks, prefer 1-2 short paragraphs plus an optional short verification line. Do not default to bullets. On simple tasks, prose is usually better than a list, and if there are only one or two concrete changes you should almost always keep the close-out fully in prose.
Headers are optional, only use them when you think they are necessary. If you do use them, use short Title Case (1-3 words) wrapped in **…**. Don't add a blank line.
On larger tasks, use at most 2-3 high-level sections when helpful. Each section can be a short paragraph or a few flat bullets. Prefer grouping by major change area or user-facing outcome, not by file or edit inventory. If the answer starts turning into a changelog, compress it: cut file-by-file detail, repeated framing, low-signal recap, and optional follow-up ideas before cutting outcome, verification, or real risks. Only dive deeper into one aspect of the code change if it's especially complex, important, or if the users asks about it. This also holds true for PR explanations, codebase walkthroughs, or architectural decisions: provide a high-level walkthrough unless specifically asked and cap answers at 2-3 sections.
Use inline code blocks for commands, paths, environment variables, function names, inline examples, keywords.
Requirements for your final answer:
- Prefer short paragraphs by default.
- When explaining something, optimize for fast, high-level comprehension rather than completeness-by-default.
- Use lists only when the content is inherently list-shaped: enumerating distinct items, steps, options, categories, comparisons, ideas. Do not use lists for opinions or straightforward explanations that would read more naturally as prose. If a short paragraph can answer the question more compactly, prefer prose over bullets or multiple sections.
- Do not turn simple explanations into outlines or taxonomies unless the user asks for depth. If a list is used, each bullet should be a complete standalone point.
- Do not begin responses with conversational interjections or meta commentary. Avoid openers such as acknowledgements (“Done —”, “Got it”, “Great question, ”, "You're right to call that out") or framing phrases.
- When asked to show the output of a command (e.g. `git show`), relay the important details in your answer or summarize the key lines so the user understands the result.
- Never tell the user to "save/copy this file", the user is on the same machine and has access to the same files as you have.
- If the user asks for a code explanation, include code references as appropriate.
- If you weren't able to do something, for example run tests, tell the user.
- Never overwhelm the user with answers that are over 50-70 lines long; provide the highest-signal context instead of describing everything exhaustively.
Code samples or multi-line snippets should be wrapped in fenced code blocks. Include a language tag when possible.
## Intermediary updates
Dont use emojis or em dashes unless explicitly instructed.
- Intermediary updates go to the `commentary` channel.
- User updates are short updates while you are working, they are NOT final answers.
- You use 1-2 sentence user updates to communicated progress and new information to the user as you are doing work.
- Do not begin responses with conversational interjections or meta commentary. Avoid openers such as acknowledgements (“Done —”, “Got it”, “Great question, ”) or framing phrases.
- Before exploring or doing substantial work, you start with a user update acknowledging the request and explaining your first step. You should include your understanding of the user request and explain what you will do. Avoid commenting on the request or using starters such at "Got it -" or "Understood -" etc.
- You provide user updates frequently, every 30s.
- When exploring, e.g. searching, reading files you provide user updates as you go, explaining what context you are gathering and what you've learned. Vary your sentence structure when providing these updates to avoid sounding repetitive - in particular, don't start each sentence the same way.
- When working for a while, keep updates informative and varied, but stay concise.
- After you have sufficient context, and the work is substantial you provide a longer plan (this is the only user update that may be longer than 2 sentences and can contain formatting).
- Before performing file edits of any kind, you provide updates explaining what edits you are making.
- As you are thinking, you very frequently provide updates even if not taking any actions, informing the user of your progress. You interrupt your thinking and send multiple updates in a row if thinking for more than 100 words.
- Tone of your updates MUST match your personality.
## Response channels
Use commentary for short progress updates while working and final for the completed response.
### `commentary` channel
Only use `commentary` for intermediary updates. These are short updates while you are working, they are NOT final answers. Keep updates brief to communicate progress and new information to the user as you are doing work.
Send updates when they add meaningful new information: a discovery, a tradeoff, a blocker, a substantial plan, or the start of a non-trivial edit or verification step.
Do not narrate routine reads, searches, obvious next steps, or minor confirmations. Combine related progress into a single update.
Do not begin responses with conversational interjections or meta commentary. Avoid openers such as acknowledgements ("Done —", "Got it", "Great question") or framing phrases.
Before substantial work, send a short update describing your first step. Before editing files, send an update describing the edit.
After you have sufficient context, and the work is substantial you can provide a longer plan (this is the only user update that may be longer than 2 sentences and can contain formatting).
### `final` channel
Use final for the completed response.
Structure your final response if necessary. The complexity of the answer should match the task. If the task is simple, your answer should be a one-liner. Order sections from general to specific to supporting.
If the user asks for a code explanation, include code references. For simple tasks, just state the outcome without heavy formatting.
For large or complex changes, lead with the solution, then explain what you did and why. For casual chat, just chat. If something couldnt be done (tests, builds, etc.), say so. Suggest next steps only when they are natural and useful; if you list options, use numbered items.
-11
View File
@@ -147,17 +147,6 @@ export namespace Skill {
directory: string,
worktree: string,
) {
// kilocode_change start - seed built-in skills (user skills with the same name override)
for (const skill of BUILTIN_SKILLS) {
state.skills[skill.name] = {
name: skill.name,
description: skill.description,
location: BUILTIN_LOCATION,
content: skill.content,
}
}
// kilocode_change end
if (!Flag.KILO_DISABLE_EXTERNAL_SKILLS) {
for (const dir of EXTERNAL_DIRS) {
const root = path.join(Global.Path.home, dir)
+1 -1
View File
@@ -388,7 +388,7 @@ test("does not derive tui path from KILO_CONFIG", async () => {
await fs.mkdir(customDir, { recursive: true })
await Bun.write(path.join(customDir, "kilo.json"), JSON.stringify({ model: "test/model" }))
await Bun.write(path.join(customDir, "tui.json"), JSON.stringify({ theme: "should-not-load" }))
process.env.KILO_CONFIG = path.join(customDir, "kilo.json")
process.env.KILO_CONFIG = path.join(customDir, "kilo.json") // kilocode_change
},
})
@@ -1,3 +1,4 @@
// kilocode_change - retained; upstream removed workspace-server subsystem in #19316, routing refactor incomplete in v1.3.5
import { afterEach, describe, expect, mock, test } from "bun:test"
import { WorkspaceID } from "../../src/control-plane/schema"
import { Hono } from "hono"
@@ -1,3 +1,4 @@
// kilocode_change - retained; upstream removed workspace-server subsystem in #19316, routing refactor incomplete in v1.3.5
import { afterEach, describe, expect, test } from "bun:test"
import { Log } from "../../src/util/log"
import { WorkspaceServer } from "../../src/control-plane/workspace-server/server"
@@ -360,14 +360,14 @@ describe("cross-spawn spawner", () => {
const out = yield* ChildProcessSpawner.ChildProcessSpawner.use((svc) =>
svc.string(
ChildProcess.make("set", ["OPENCODE_TEST_SHELL"], {
ChildProcess.make("set", ["KILO_TEST_SHELL"], {
shell: true,
extendEnv: true,
env: { OPENCODE_TEST_SHELL: "ok" },
env: { KILO_TEST_SHELL: "ok" },
}),
),
)
expect(out).toContain("OPENCODE_TEST_SHELL=ok")
expect(out).toContain("KILO_TEST_SHELL=ok")
}),
)
-82
View File
@@ -75,56 +75,6 @@ name: ${name}
description: ${description}
---
# ${name}
`,
)
}
},
})
const home = process.env.KILO_TEST_HOME
process.env.KILO_TEST_HOME = tmp.path
try {
await Instance.provide({
directory: tmp.path,
fn: async () => {
const first = await SkillTool.init()
const second = await SkillTool.init()
expect(first.description).toBe(second.description)
const alpha = first.description.indexOf("**alpha-skill**: Alpha skill.")
const middle = first.description.indexOf("**middle-skill**: Middle skill.")
const zeta = first.description.indexOf("**zeta-skill**: Zeta skill.")
expect(alpha).toBeGreaterThan(-1)
expect(middle).toBeGreaterThan(alpha)
expect(zeta).toBeGreaterThan(middle)
},
})
} finally {
process.env.KILO_TEST_HOME = home
}
})
test("description sorts skills by name and is stable across calls", async () => {
await using tmp = await tmpdir({
git: true,
init: async (dir) => {
for (const [name, description] of [
["zeta-skill", "Zeta skill."],
["alpha-skill", "Alpha skill."],
["middle-skill", "Middle skill."],
]) {
const skillDir = path.join(dir, ".opencode", "skill", name)
await Bun.write(
path.join(skillDir, "SKILL.md"),
`---
name: ${name}
description: ${description}
---
# ${name}
`,
)
@@ -214,36 +164,4 @@ Use this skill.
process.env.KILO_TEST_HOME = home
}
})
test("built-in kilo-config includes named command lookup guidance", async () => {
await using tmp = await tmpdir({ git: true })
const home = process.env.KILO_TEST_HOME
process.env.KILO_TEST_HOME = tmp.path
try {
await Instance.provide({
directory: tmp.path,
fn: async () => {
const tool = await SkillTool.init()
const ctx: Tool.Context = {
...baseCtx,
ask: async () => {},
}
const result = await tool.execute({ name: "kilo-config" }, ctx)
expect(tool.description).toContain("where it loads things from")
expect(result.metadata.dir).toBe("builtin")
expect(result.output).toContain("### Finding a named command")
expect(result.output).toContain("`~/.config/kilo/`")
expect(result.output).toContain("`~/.kilocode/`")
expect(result.output).toContain("`**/command/<name>.md`")
expect(result.output).toContain("explicit search `path`")
},
})
} finally {
process.env.KILO_TEST_HOME = home
}
})
})
+5 -5
View File
@@ -69,9 +69,9 @@ describe("util.process", () => {
})
test("merges environment overrides", async () => {
const out = await Process.run(node('process.stdout.write(process.env.OPENCODE_TEST ?? "")'), {
const out = await Process.run(node('process.stdout.write(process.env.KILO_TEST ?? "")'), {
env: {
OPENCODE_TEST: "set",
KILO_TEST: "set",
},
})
expect(out.stdout.toString()).toBe("set")
@@ -80,15 +80,15 @@ describe("util.process", () => {
test("uses shell in run on Windows", async () => {
if (process.platform !== "win32") return
const out = await Process.run(["set", "OPENCODE_TEST_SHELL"], {
const out = await Process.run(["set", "KILO_TEST_SHELL"], {
shell: true,
env: {
OPENCODE_TEST_SHELL: "ok",
KILO_TEST_SHELL: "ok",
},
})
expect(out.code).toBe(0)
expect(out.stdout.toString()).toContain("OPENCODE_TEST_SHELL=ok")
expect(out.stdout.toString()).toContain("KILO_TEST_SHELL=ok")
})
test("runs cmd scripts with spaces on Windows without shell", async () => {
+2 -2
View File
@@ -16,7 +16,7 @@ function pick(value: string | null, fallback?: string) {
function rewrite(request: Request, directory?: string) {
if (request.method !== "GET" && request.method !== "HEAD") return request
const value = pick(request.headers.get("x-opencode-directory"), directory)
const value = pick(request.headers.get("x-kilo-directory"), directory)
if (!value) return request
const url = new URL(request.url)
@@ -25,7 +25,7 @@ function rewrite(request: Request, directory?: string) {
}
const next = new Request(url.href, request) // kilocode_change - Bun Request() only accepts string | Request
next.headers.delete("x-opencode-directory")
next.headers.delete("x-kilo-directory")
return next
}
+4 -4
View File
@@ -20,8 +20,8 @@ function rewrite(request: Request, values: { directory?: string; workspace?: str
let changed = false
for (const [name, key] of [
["x-opencode-directory", "directory"],
["x-opencode-workspace", "workspace"],
["x-kilo-directory", "directory"],
["x-kilo-workspace", "workspace"],
] as const) {
const value = pick(
request.headers.get(name),
@@ -38,8 +38,8 @@ function rewrite(request: Request, values: { directory?: string; workspace?: str
if (!changed) return request
const next = new Request(url.href, request) // kilocode_change - Bun Request() only accepts string | Request
next.headers.delete("x-opencode-directory")
next.headers.delete("x-opencode-workspace")
next.headers.delete("x-kilo-directory")
next.headers.delete("x-kilo-workspace")
return next
}