GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE]: Filter TUI session list by current directory/worktree · Issue #9881 · anomalyco/opencode

[FEATURE]: Filter TUI session list by current directory/worktree #9881

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
[FEATURE]: Filter TUI session list by current directory/worktree#9881
Copy link
Assignees
thdxr

Description

@allisoneer
allisoneer
opened on Jan 21, 2026
Issue body actions

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem: Sessions are shared across all git worktrees of the same repository because they use projectID (first root commit hash) as the storage key. Users working with multiple worktrees see sessions from all worktrees mixed together, making it difficult to find relevant sessions.

Proposed Solution: Wire up the existing directory API filter so the TUI only shows sessions from the current working directory.

The infrastructure already exists:

  • API supports GET /session?directory=<path> (exact match filter)
  • tui() accepts a directory prop but it's never passed
  • SDK supports directory parameter in session.list()

Changes needed (TUI-only, no server changes):

  1. Pass directory: cwd to tui() call in thread.ts
  2. Add directory param to bootstrap session.list call in sync.tsx
  3. Filter session.updated realtime events by directory (prevent cross-worktree sessions appearing)
  4. Add directory param to session search in dialog-session-list.tsx

Alternatives considered:

  • Server-side auto-filter: Rejected because it changes behavior for all clients (web UI, API consumers may want cross-worktree visibility). TUI-only approach is purely additive.
  • Plugin approach: Not feasible - no plugin hook exists for session listing.
  • Hidden session field: Out of scope - separate feature that requires schema changes.

Known limitations:

  • Uses exact directory match (API behavior). Sessions created from a subdirectory won't appear when TUI is launched from repo root.
  • No config toggle - filtering is always-on (this is the expected UX for worktree users).

Happy to submit a PR if this approach sounds reasonable.

Reacted by Zubeen Tolani

Activity

  1. github-actions
    assigned
    thdxr
    on Jan 21, 2026
  2. github-actions
    added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Jan 21, 2026
  3. github-actions commented on Jan 21, 2026

    @github-actions
    github-actionsBot
    on Jan 21, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • session list is showing all sessions not only the ones scopes to the curent dir #8836: Session list is showing all sessions instead of scoped to current directory (exact same symptom)
    • [BUG]: Project ID collision when repos cloned from same source share sessions #6696: Project ID collision when repos cloned from same source share sessions (related root cause)
    • [BUG]: Session switching doesn't change working directory context #6697: Session switching doesn't change working directory context (related issue with directory context)
    • Desktop app: opening multiple git worktrees from the same repo replaces existing project #5638: Multiple git worktrees from same repo replace existing project (same root cause for worktrees)
    • Feature Request: Plugin hook for filtering session list in /sessions dialog #9553: Plugin hook for filtering session list in /sessions dialog (alternative approach for filtering)
    • [FEATURE]: Session filters #3758: General session filters feature request

    Feel free to ignore if these don't address your specific case. Issue #8836 in particular seems to describe the exact same symptom you're addressing with this feature request.

  4. allisoneer commented on Jan 21, 2026

    @allisoneer
    allisoneer
    on Jan 21, 2026
    Author
    More actions

    Closing as duplicate of #8836.

    The existing issue #8836 tracks this same problem, and there are already two open PRs attempting to fix it:

    • PR fix(tui): scope session list to current directory (#8836) #8886 - client-side filtering in the session list dialog
    • PR feat(session): filter sessions by current directory #6724 - server-side filtering with --all opt-out

    I've added a comment to #8836 with analysis of these approaches and a proposed more complete solution.

  5. allisoneer
    closed this as completedon Jan 21, 2026
  6. libardoram
    marked stats --project '' flag does not filter by current project #9958 as a duplicate of this issue on Jan 22, 2026
  7. allisoneer
    reopened this on Mar 25, 2026
  8. allisoneer commented on Mar 25, 2026

    @allisoneer
    allisoneer
    on Mar 25, 2026
    Author
    More actions

    Dax please do this it's been so long and the other issue hasn't gone anywhere and it's still an unbelievable pain in the ass and the code changes are very small and detailed accurately above. pretty pretty please.

    Reacted by CT, Zubeen Tolani and Bukit Sorrento
  9. thdxr
    removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  10. github-actions commented on Jul 6, 2026

    @github-actions
    github-actionsBot
    on Jul 6, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  11. github-actions
    closed this as not plannedon Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @thdxr
    thdxr

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.