Skip to content

Commit 69e6ef6

Browse files
authored
add Kilo legacy VSCode extension agent support (#1209)
This PR adds support for the original (legacy) Kilo Code agent VSCode extension. This agent parser covers the pre-OpenCode legacy extension (the RooCode-derived codebase). Kilo released a rebuilt VS Code extension on an OpenCode core in March 2026, which is already supported by the main `kilo` parser in AgentsView. Co-authored-by: Stephen Cross <scross01@users.noreply.github.com>
1 parent c664fde commit 69e6ef6

19 files changed

Lines changed: 3761 additions & 29 deletions

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ thread JSON files.
334334
| Hermes Agent | `~/.hermes/sessions/` |
335335
| iFlow | `~/.iflow/projects/` |
336336
| Kilo | `~/.local/share/kilo/` |
337+
| Kilo (legacy) | `~/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code/` (macOS), `~/.config/Code/User/globalStorage/kilocode.kilo-code/` (Linux) |
337338
| Kimi | `~/.kimi/sessions/` |
338339
| Kiro CLI | `~/.kiro/sessions/cli/`, `~/.local/share/kiro-cli/` |
339340
| Kiro IDE | `~/Library/Application Support/Kiro/` (macOS) |
@@ -464,6 +465,13 @@ Sidecars stay on your machine. agentsview makes no outbound request to produce
464465
or read them, and treats sidecars as untrusted structured input -- see
465466
[SECURITY.md](SECURITY.md) for the trust model.
466467

468+
### Kilo vs Kilo (legacy).
469+
470+
*Kilo* is the OpenCode-based CLI/editor core (`~/.local/share/kilo/kilo.db`);
471+
it covers both the Kilo CLI and the rebuilt Kilo Code VS Code extension (after
472+
March 2026), which shares that same database. *Kilo (legacy)* is the legacy RooCode-derived
473+
VS Code extension that wrote per-task JSON under `kilocode.kilo-code/tasks/`.
474+
467475
## PostgreSQL Sync
468476

469477
Push session data to a shared PostgreSQL instance for team dashboards:

docs/configuration.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ can still be parsed.
256256
| Kimi | `~/.kimi/sessions/` and `~/.kimi-code/sessions/` | JSONL per session |
257257
| Kiro CLI | `~/.kiro/sessions/cli/` and `~/.local/share/kiro-cli/` | JSONL per session and SQLite database |
258258
| Kiro IDE | (platform-specific, see below) | JSON / chat files |
259+
| Kilo (legacy) | (platform-specific, see below) | `tasks/<uuid>/{task_metadata.json,ui_messages.json,api_conversation_history.json}` |
259260
| MiMoCode | `~/.local/share/mimocode/` | SQLite DB or `storage/` JSON files |
260261
| Mistral Vibe | `~/.vibe/logs/session/` | Per-session `messages.jsonl` plus `meta.json` |
261262
| OhMyPi | `~/.omp/agent/sessions/` | JSONL per session |
@@ -461,6 +462,35 @@ RooCode was shut down on May 15, 2026. ZooCode (Zoo-CodeInc.zoo-cline) is the
461462
active community fork and will be supported separately. Set `ROOCODE_DIR` or
462463
`roocode_dirs` if your VSCode globalStorage directory is elsewhere.
463464

465+
**Kilo (legacy) default directories** vary by platform, all rooted at the
466+
canonical lowercase `kilocode.kilo-code` global storage directory that VSCode
467+
writes on disk:
468+
469+
- **macOS:** `~/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code/`
470+
- **Linux:** `~/.config/Code/User/globalStorage/kilocode.kilo-code/`
471+
- **Windows:** `%APPDATA%/Code/User/globalStorage/kilocode.kilo-code/`
472+
473+
Each `<root>/tasks/<uuid>/` task directory carries three JSON files:
474+
`task_metadata.json` (only stores `files_in_context`), the Claude-shaped
475+
`api_conversation_history.json`, and the Cline-shaped `ui_messages.json`.
476+
AgentsView folds the latter two into a composite fingerprint with
477+
`task_metadata.json` as the source anchor so changes to any of the three trigger
478+
a reparse. Sessions are parsed through RooCode-descended Cline message handling
479+
(tool-call and result pairing, reasoning pipeline, compact boundaries, error
480+
linking). Set `KILO_LEGACY_DIR` or `kilo_legacy_dirs` when the legacy extension
481+
stores its data outside the standard locations.
482+
483+
**Kilo (legacy) vs Kilo.** These are two different agents. *Kilo* (the
484+
`kilo` agent) is the OpenCode-based core at `~/.local/share/kilo/`; it
485+
covers both the Kilo CLI and the rebuilt Kilo Code VS Code extension,
486+
which share that same `kilo.db`. *Kilo (legacy)* (the `kilo-legacy` agent)
487+
is the legacy RooCode-derived VS Code extension that wrote per-task JSON
488+
under `kilocode.kilo-code/tasks/` and stopped receiving new sessions after
489+
Kilo rebuilt the extension on OpenCode (public beta 2026-03-10, GA
490+
2026-04-02). The `kilo-legacy` agent is frozen at that legacy format and
491+
only archives older sessions; newer Kilo VS Code activity appears under
492+
`kilo`.
493+
464494
**Antigravity CLI transcript sources:** Antigravity CLI has used both SQLite
465495
databases and AES-encrypted `.pb` files. AgentsView reads whichever source is
466496
richest, in this order:
@@ -532,6 +562,7 @@ export KILO_DIR=~/custom/kilo
532562
export KIMI_DIR=~/custom/kimi
533563
export KIRO_SESSIONS_DIR=~/custom/kiro
534564
export KIRO_IDE_DIR=~/custom/kiro-ide
565+
export KILO_LEGACY_DIR=~/custom/kilo-legacy
535566
export MIMOCODE_DIR=~/custom/mimocode
536567
export VIBE_SESSIONS_DIR=~/custom/vibe/logs/session
537568
export OMP_DIR=~/custom/omp
@@ -580,8 +611,7 @@ The corresponding fields are `aider_dirs`, `amp_dirs`, `antigravity_dirs`,
580611
`cowork_dirs`, `devin_dirs`, `codex_sessions_dirs`, `commandcode_project_dirs`,
581612
`copilot_dirs`, `cortex_dirs`, `cursor_project_dirs`,
582613
`deepseek_tui_sessions_dirs`, `forge_dirs`, `gemini_dirs`, `gptme_dirs`,
583-
`grok_dirs`, `hermes_sessions_dirs`, `iflow_dirs`, `kilo_dirs`, `kimi_dirs`,
584-
`kiro_dirs`, `kiro_ide_dirs`, `mimocode_dirs`, `vibe_session_dirs`,
614+
`grok_dirs`, `hermes_sessions_dirs`, `iflow_dirs`, `kilo_dirs`, `kilo_legacy_dirs`, `kimi_dirs`, `kiro_dirs`, `kiro_ide_dirs`, `mimocode_dirs`, `vibe_session_dirs`,
585615
`omp_dirs`, `openclaw_dirs`, `opencode_dirs`, `openhands_dirs`, `pi_dirs`,
586616
`piebald_dirs`, `posit_assistant_dirs`, `positron_dirs`, `qclaw_dirs`,
587617
`qoder_project_dirs`, `qwen_project_dirs`, `qwenpaw_dirs`, `reasonix_dirs`, `roocode_dirs`,

docs/internal/session-format-sources.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,31 @@ Grok section and remove the explicit registry exception in the coverage test.
233233
Kilo migrations mean the pinned current source must be compared with legacy
234234
fixtures when changing compatibility.
235235

236+
## Kilo (legacy) (`kilo-legacy`)
237+
238+
- **Format:** Pre-OpenCode Kilo VSCode extension (`kilocode.kilo-code`) task
239+
directories under VSCode `globalStorage`. Each session holds
240+
`task_metadata.json` (files-in-context only), the Claude-shaped
241+
`api_conversation_history.json`, and the Cline-shaped `ui_messages.json`.
242+
- **Evidence:** `source`.
243+
- **Upstream:** Clone `https://github.com/Kilo-Org/kilocode.git` at
244+
`938919ab72e3977d1512e0363417270e3337c7b1`. The pinned
245+
[task persistence](https://github.com/Kilo-Org/kilocode/blob/938919ab72e3977d1512e0363417270e3337c7b1/src/core/task-persistence/TaskHistoryStore.ts)
246+
and
247+
[UI message reader](https://github.com/Kilo-Org/kilocode/blob/938919ab72e3977d1512e0363417270e3337c7b1/src/core/task-persistence/taskMessages.ts)
248+
own the Cline-shaped transcript. The extension was superseded by the
249+
OpenCode-based rebuild (public beta 2026-03-10, GA 2026-04-02); new sessions
250+
stopped appearing around 2026-03-21.
251+
- **Usage and cost:** `ui_messages.json` carries per-request `api_req_started`
252+
metadata with input, output, cache-read, and cache-write tokens, explicit USD
253+
cost, and `usageMissing` flag. `task_metadata.json` does not carry the
254+
RooCode-style ID/token/cost wiring; token and cost totals are derived from
255+
the transcript itself.
256+
- **Agentsview:** `internal/parser/kilo_legacy.go` and
257+
`internal/parser/kilo_legacy_provider.go`; the parser borrows RooCode's
258+
Cline message handling (tool-call pairing, reasoning, compact boundaries,
259+
error linking). New sessions stopped after the OpenCode migration.
260+
236261
## Roo Code (`roocode`)
237262

238263
- **Format:** One task directory per session with `history_item.json` metadata

frontend/src/lib/utils/agents.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ describe("KNOWN_AGENTS", () => {
1818
"devin",
1919
"gemini",
2020
"opencode",
21+
"kilo",
22+
"kilo-legacy",
2123
"openhands",
2224
"cursor",
2325
"amp",

frontend/src/lib/utils/agents.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export const KNOWN_AGENTS: readonly AgentMeta[] = [
1212
{ name: "devin", color: "var(--accent-red)", label: "Devin" },
1313
{ name: "gemini", color: "var(--accent-rose)" },
1414
{ name: "opencode", color: "var(--accent-purple)" },
15+
{ name: "kilo", color: "var(--accent-purple)", label: "Kilo" },
16+
{ name: "kilo-legacy", color: "var(--accent-purple)", label: "Kilo (legacy)" },
1517
{ name: "openhands", color: "var(--accent-teal)", label: "OpenHands" },
1618
{ name: "cursor", color: "var(--accent-black)" },
1719
{ name: "amp", color: "var(--accent-coral)", label: "Amp" },

0 commit comments

Comments
 (0)