Skip to content

fix(cli): filter sessions by worktree#9988

Open
alex-alecu wants to merge 5 commits intomainfrom
fix/session-worktree-filter
Open

fix(cli): filter sessions by worktree#9988
alex-alecu wants to merge 5 commits intomainfrom
fix/session-worktree-filter

Conversation

@alex-alecu
Copy link
Copy Markdown
Contributor

@alex-alecu alex-alecu commented May 7, 2026

Why

Followup to #8971

The sessions list did not show the right sessions when someone pressed Ctrl+A. Sessions from deleted worktrees could also disappear even though they were still saved on the computer.

What changed

The sessions list now knows the exact worktree each session belongs to. Pressing Ctrl+A now filters to only the current worktree instead of guessing from path text. Sessions from deleted worktrees still show up because they are read from the local saved data. Tests cover nested worktrees and deleted worktrees so this does not break again.

How to test

Screen.Recording.2026-05-07.at.10.48.00.mov
  1. Open Kilo in a repo with sessions from the root and from a worktree.
  2. Run /sessions, then press Ctrl+A.
  3. Check that only sessions from the current worktree are shown.
  4. Delete a worktree from disk, run /sessions from the root repo, and check that its saved sessions still appear.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 7, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (8 files)
  • packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx
  • packages/opencode/src/kilocode/session/index.ts
  • packages/opencode/src/kilocode/worktree-family.ts
  • packages/opencode/src/server/routes/instance/experimental.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/test/kilocode/session-worktree-list.test.ts
  • packages/sdk/js/src/v2/gen/types.gen.ts
  • packages/sdk/openapi.json

Reviewed by gpt-5.5-2026-04-23 · 941,035 tokens

@alex-alecu alex-alecu enabled auto-merge May 7, 2026 07:50
Copy link
Copy Markdown
Contributor

@markijbema markijbema left a comment

Choose a reason for hiding this comment

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

This logic is all changed in .33, so I'd rather wait until after that merge,b ecause we might need to implement this quite differently

@markijbema markijbema dismissed their stale review May 7, 2026 10:29

merge is merged

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