Skip to content

fix(sessions): scope the session picker to the OpenCode project across worktrees - #410

Merged
chriswritescode-dev merged 1 commit into
mainfrom
fix/session-picker-project-scope
Oct 9, 2026
Merged

chriswritescode-dev merged 1 commit into
mainfrom
fix/session-picker-project-scope

Conversation

@chriswritescode-dev

Copy link
Copy Markdown
Owner

Summary

The Sessions picker "This project" scope enumerated repo siblings to find worktree directories, which missed worktrees and schedule run directories. It now resolves the repository's OpenCode project via the location API and lists sessions across that project in a single cursor query.

  • This-project scope queries by OpenCode project id and subpath instead of walking repo siblings.
  • Worktree rows are labeled with the worktree folder name derived from the session root relative to the project canonical path.
  • Falls back to the repo directory listing when the location is global or the lookup fails, and holds the query while the location is pending.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation

Checklist

  • Code follows project style (no comments, named imports)
  • TypeScript types are properly defined
  • Tests added/updated (80% coverage target)
  • pnpm lint passes locally
  • pnpm typecheck passes locally

Frontend typecheck and lint pass. SessionPickerDialog, useOpenCode, and useSessionSearch tests pass (38/38).

@chriswritescode-dev
chriswritescode-dev merged commit 4180265 into main Oct 9, 2026
1 check passed
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0b7a238e-59a0-47fc-970a-f807eea67bf9
📥 Commits

Reviewing files that changed from the base of the PR and between 04cb3f8 and e40eca2.

📒 Files selected for processing (7)
  • frontend/src/api/opencode.ts
  • frontend/src/components/session/SessionPickerDialog.test.tsx
  • frontend/src/components/session/SessionPickerDialog.tsx
  • frontend/src/hooks/useOpenCode.test.tsx
  • frontend/src/hooks/useOpenCode.ts
  • frontend/src/hooks/useSessionSearch.test.tsx
  • frontend/src/hooks/useSessionSearch.ts
 _____________________________________________________________________________________________________________________________________________________________________________________________________
< Don't think outside the box - find the box. When faced with an impossible problem, identify the real constraints. Ask yourself: 'Does it have to be done this way? Does it have to be done at all?' >
 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant