Skip to content

fix(cli): stabilize Kilo Console worktree flows - #11279

Merged
catrielmuller merged 9 commits into
mainfrom
catrielmuller/kilo-console-persist
Jun 16, 2026
Merged

fix(cli): stabilize Kilo Console worktree flows#11279
catrielmuller merged 9 commits into
mainfrom
catrielmuller/kilo-console-persist

Conversation

@catrielmuller

@catrielmuller catrielmuller commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Issue

No linked issue. This is follow-up work from local branch review findings and Kilo Console/TUI regressions found on this branch.

Context

This PR stabilizes Kilo Console and TUI flows around worktrees, sessions, console preferences, and development-shell directory handling. It also addresses local review findings that external Git worktrees were being exposed to Kilo-managed destructive actions and that custom-channel DB users could lose visible persistence after the channel DB filename change.

Implementation

Kilo Console now lists Git worktrees through the experimental worktree endpoint while the endpoint marks whether each worktree is Kilo-managed. The console keeps external worktrees visible for session startup and review, but only shows reset/delete actions for managed worktrees.

The TUI sessions dialog now defaults to current-worktree scope and uses the server-side current/all worktree filtering path so the scope toggle works even when a scope has no sessions. Console global preference updates can hot-apply without disposing active instances, and mounted console views refetch on global.config.updated while avoiding resize-driven terminal refetch churn.

kilo-dev now preserves the caller directory while running the CLI from packages/opencode, and custom channel DB paths use kilo-${channel}.db while falling back to existing opencode-${channel}.db files when the new DB does not exist. SDK/OpenAPI artifacts were regenerated for the new worktree list response shape.

Screenshots / Video

N/A. The visual impact is limited to conditionally hiding existing Reset/Delete controls for unmanaged external worktrees; reviewer steps below cover that state.

How to Test

Manual/local verification

  • Executed by agent: bun test ./test/kilocode/server/worktree-list.test.ts ./test/kilocode/storage/db.test.ts ./test/storage/db.test.ts from packages/opencode passed.
  • Executed by agent: bun run typecheck from packages/opencode passed.
  • Executed by agent: bun run typecheck from packages/kilo-console passed.
  • Executed by agent: bun run script/check-opencode-annotations.ts from the repo root passed.
  • Executed by agent via pre-push hook: bun turbo typecheck passed during git push.

Reviewer test steps

  1. Open Kilo Console for a Git project that has both a Kilo-created worktree and a manually-created external Git worktree.
  2. Confirm both worktrees appear in the project view and can be selected for starting sessions or viewing diffs.
  3. Confirm Reset/Delete controls are available for Kilo-managed worktrees and absent for unmanaged external worktrees.
  4. Change a global console preference such as diff layout or context sidebar width and confirm active console terminals stay open while mounted console state refreshes.
  5. Open the TUI sessions dialog and confirm it defaults to current-worktree sessions and the current/all scope toggle works even when the current scope has no sessions.
  6. For an existing custom-channel DB named opencode-${channel}.db, confirm the CLI still opens that DB when kilo-${channel}.db is not present.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

@kilo-code-bot

kilo-code-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file changed, 22 total from full diff)
  • packages/opencode/test/server/httpapi-experimental.test.ts
  • .changeset/fix-session-scope-toggle.md
  • .changeset/list-agent-manager-worktrees.md
  • .changeset/preserve-console-review-expansion.md
  • .changeset/preserve-console-terminals.md
  • flake.nix
  • packages/kilo-console/src/client.ts
  • packages/kilo-console/src/routes/projects/ProjectConsoleRoute.tsx
  • packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx
  • packages/opencode/src/cli/cmd/tui/thread.ts
  • packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx
  • packages/opencode/src/kilocode/server/httpapi/handlers/config-console.ts
  • packages/opencode/src/kilocode/session/index.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/experimental.ts
  • packages/opencode/src/server/routes/instance/httpapi/handlers/experimental.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/src/storage/db.ts
  • packages/opencode/test/kilocode/cli/tui/thread.test.ts
  • packages/opencode/test/kilocode/server/config-overlay.test.ts
  • packages/opencode/test/kilocode/server/worktree-list.test.ts
  • packages/opencode/test/kilocode/storage/db.test.ts
  • packages/opencode/test/server/experimental-session-list.test.ts
  • packages/opencode/test/storage/db.test.ts
  • packages/sdk/js/src/v2/gen/sdk.gen.ts
  • packages/sdk/js/src/v2/gen/types.gen.ts
  • packages/sdk/openapi.json
  • packages/ui/src/components/provider-icons/sprite.svg
  • packages/ui/src/components/provider-icons/types.ts
Other Observations (carried forward from previous review)

The atomic-chat icon in packages/ui/src/components/provider-icons/sprite.svg was changed from pure SVG <rect> shapes to a base64-encoded <image> (PNG). This change:

  • Appears unrelated to the PR's console/worktree/session scope
  • Replaces a scalable vector graphic with a fixed-size raster image
  • Was not mentioned in the PR description or changesets

If intentional, no action needed. If accidental (e.g., a merge artifact), it should be reverted.

Previous Review Summaries (4 snapshots, latest commit 3395131)

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

Previous review (commit 3395131)

Status: No Issues Found | Recommendation: Merge

The incremental diff contains a single test assertion update that aligns the worktree list test with the updated API response shape ({ directory, managed } objects instead of plain strings). No behavioral issues.

Files Reviewed (1 file changed, 22 total)
  • packages/opencode/test/server/httpapi-experimental.test.ts
  • .changeset/fix-session-scope-toggle.md
  • .changeset/list-agent-manager-worktrees.md
  • .changeset/preserve-console-review-expansion.md
  • .changeset/preserve-console-terminals.md
  • flake.nix
  • packages/kilo-console/src/client.ts
  • packages/kilo-console/src/routes/projects/ProjectConsoleRoute.tsx
  • packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx
  • packages/opencode/src/cli/cmd/tui/thread.ts
  • packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx
  • packages/opencode/src/kilocode/server/httpapi/handlers/config-console.ts
  • packages/opencode/src/kilocode/session/index.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/experimental.ts
  • packages/opencode/src/server/routes/instance/httpapi/handlers/experimental.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/src/storage/db.ts
  • packages/opencode/test/kilocode/cli/tui/thread.test.ts
  • packages/opencode/test/kilocode/server/config-overlay.test.ts
  • packages/opencode/test/kilocode/server/worktree-list.test.ts
  • packages/opencode/test/kilocode/storage/db.test.ts
  • packages/opencode/test/server/experimental-session-list.test.ts
  • packages/opencode/test/storage/db.test.ts
  • packages/sdk/js/src/v2/gen/sdk.gen.ts
  • packages/sdk/js/src/v2/gen/types.gen.ts
  • packages/sdk/openapi.json
  • packages/ui/src/components/provider-icons/sprite.svg
  • packages/ui/src/components/provider-icons/types.ts
Other Observations (carried forward from previous review)

The atomic-chat icon in packages/ui/src/components/provider-icons/sprite.svg was changed from pure SVG <rect> shapes to a base64-encoded <image> (PNG). This change:

  • Appears unrelated to the PR's console/worktree/session scope
  • Replaces a scalable vector graphic with a fixed-size raster image
  • Was not mentioned in the PR description or changesets

If intentional, no action needed. If accidental (e.g., a merge artifact), it should be reverted.

Previous review (commit fbdcc75)

Status: No Issues Found | Recommendation: Merge

The incremental diff (0c0b95f..HEAD) contains formatting-only changes: line-break reformatting, comment placement, and auto-generated SDK reordering. No behavioral changes.

Other Observations (not blocking, from previous review)

The atomic-chat icon in packages/ui/src/components/provider-icons/sprite.svg was changed from pure SVG <rect> shapes to a base64-encoded <image> (PNG). This change:

  • Appears unrelated to the PR's console/worktree/session scope
  • Replaces a scalable vector graphic with a fixed-size raster image
  • Was not mentioned in the PR description or changesets

If intentional, no action needed. If accidental (e.g., a merge artifact), it should be reverted.

Files Reviewed (22 files)
  • .changeset/fix-session-scope-toggle.md
  • .changeset/list-agent-manager-worktrees.md
  • .changeset/preserve-console-review-expansion.md
  • .changeset/preserve-console-terminals.md
  • flake.nix
  • packages/kilo-console/src/client.ts
  • packages/kilo-console/src/routes/projects/ProjectConsoleRoute.tsx
  • packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx
  • packages/opencode/src/cli/cmd/tui/thread.ts
  • packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx
  • packages/opencode/src/kilocode/server/httpapi/handlers/config-console.ts
  • packages/opencode/src/kilocode/session/index.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/experimental.ts
  • packages/opencode/src/server/routes/instance/httpapi/handlers/experimental.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/src/storage/db.ts
  • packages/opencode/test/kilocode/cli/tui/thread.test.ts
  • packages/opencode/test/kilocode/server/config-overlay.test.ts
  • packages/opencode/test/kilocode/server/worktree-list.test.ts
  • packages/opencode/test/kilocode/storage/db.test.ts
  • packages/opencode/test/server/experimental-session-list.test.ts
  • packages/opencode/test/storage/db.test.ts
  • packages/sdk/js/src/v2/gen/sdk.gen.ts
  • packages/sdk/js/src/v2/gen/types.gen.ts
  • packages/sdk/openapi.json
  • packages/ui/src/components/provider-icons/sprite.svg
  • packages/ui/src/components/provider-icons/types.ts

Previous review (commit 0c0b95f)

Status: No Issues Found | Recommendation: Merge

A single minor observation about the atomic-chat icon change is noted below — no inline comments were posted.

Other Observations (not blocking)

The atomic-chat icon in packages/ui/src/components/provider-icons/sprite.svg was changed from pure SVG <rect> shapes to a base64-encoded <image> (PNG). This change:

  • Appears unrelated to the PR's console/worktree/session scope
  • Replaces a scalable vector graphic with a fixed-size raster image
  • Was not mentioned in the PR description or changesets

If intentional, no action needed. If accidental (e.g., a merge artifact), it should be reverted.

Files Reviewed (18 files)
  • flake.nix
  • packages/kilo-console/src/routes/projects/ProjectConsoleRoute.tsx
  • packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx
  • packages/opencode/src/cli/cmd/tui/thread.ts
  • packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx
  • packages/opencode/src/kilocode/server/httpapi/handlers/config-console.ts
  • packages/opencode/src/kilocode/session/index.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/experimental.ts
  • packages/opencode/src/server/routes/instance/httpapi/handlers/experimental.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/src/storage/db.ts
  • packages/opencode/test/kilocode/cli/tui/thread.test.ts
  • packages/opencode/test/kilocode/server/config-overlay.test.ts
  • packages/opencode/test/kilocode/server/worktree-list.test.ts
  • packages/opencode/test/kilocode/storage/db.test.ts
  • packages/opencode/test/server/experimental-session-list.test.ts
  • packages/opencode/test/storage/db.test.ts
  • packages/sdk/js/src/v2/gen/sdk.gen.ts
  • packages/sdk/js/src/v2/gen/types.gen.ts
  • packages/sdk/openapi.json
  • packages/ui/src/components/provider-icons/sprite.svg
  • packages/ui/src/components/provider-icons/types.ts

Previous review (commit 4e5ee56)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (27 files)
  • .changeset/fix-session-scope-toggle.md
  • .changeset/list-agent-manager-worktrees.md
  • .changeset/preserve-console-review-expansion.md
  • .changeset/preserve-console-terminals.md
  • flake.nix
  • packages/kilo-console/src/client.ts
  • packages/kilo-console/src/routes/projects/ProjectConsoleRoute.tsx
  • packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx
  • packages/opencode/src/cli/cmd/tui/thread.ts
  • packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx
  • packages/opencode/src/kilocode/server/httpapi/handlers/config-console.ts
  • packages/opencode/src/kilocode/session/index.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/experimental.ts
  • packages/opencode/src/server/routes/instance/httpapi/handlers/experimental.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/src/storage/db.ts
  • packages/opencode/test/kilocode/cli/tui/thread.test.ts
  • packages/opencode/test/kilocode/server/config-overlay.test.ts
  • packages/opencode/test/kilocode/server/worktree-list.test.ts
  • packages/opencode/test/kilocode/storage/db.test.ts
  • packages/opencode/test/server/experimental-session-list.test.ts
  • packages/opencode/test/storage/db.test.ts
  • packages/sdk/js/src/v2/gen/sdk.gen.ts
  • packages/sdk/js/src/v2/gen/types.gen.ts
  • packages/sdk/openapi.json
  • packages/ui/src/components/provider-icons/sprite.svg
  • packages/ui/src/components/provider-icons/types.ts

Reviewed by deepseek-v4-pro-20260423 · 330,064 tokens

Review guidance: REVIEW.md from base branch main

@catrielmuller
catrielmuller force-pushed the catrielmuller/kilo-console-persist branch from 4e5ee56 to 0c0b95f Compare June 16, 2026 00:33
@catrielmuller
catrielmuller merged commit caae74d into main Jun 16, 2026
22 checks passed
@catrielmuller
catrielmuller deleted the catrielmuller/kilo-console-persist branch June 16, 2026 04:22
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…nsole-persist

fix(cli): stabilize Kilo Console worktree flows
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.

2 participants