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 — fix(tui): scope session list to current directory (#8836) by shoaibansari5398 · Pull Request #8886 · anomalyco/opencode

Conversation

@shoaibansari5398

@shoaibansari5398 shoaibansari5398 commented Jan 16, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes #8836 - Scopes the session list (/sessions command) to the current working directory.

Problem: When using /sessions or opening the session list dialog, it displayed ALL sessions from ALL directories/projects instead of only sessions that belong to the current working directory.

How did you verify your code works?

Root Cause: The
dialog-session-list.tsx
component only filtered sessions by parentID === undefined (to exclude child sessions) but didn't filter by the session's directory field.

Solution: Added a directory filter to only show sessions where session.directory === currentDirectory:

diff
const options = createMemo(() => {
const today = new Date().toDateString()

  • const currentDirectory = sync.data.path.directory || process.cwd()
    return sessions()
  •  .filter((x) => x.parentID === undefined)
    
  •  .filter((x) => x.parentID === undefined && x.directory === currentDirectory)
    

How did you verify your code works?

Code review confirmed that Session.Info schema has a directory field that stores the working directory when a session is created
The filter uses the same path source (sync.data.path.directory) that's used elsewhere in the TUI (e.g.,
useDirectory
context)
The || process.cwd() fallback ensures the filter still works if sync.data.path.directory is not yet populated

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@shoaibansari5398
fix(tui): scope session list to current directory (anomalyco#8836)
93c1b86
@github-actions

github-actions Bot commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found one potentially related PR:

Potential Duplicate:

  • PR feat(session): filter sessions by current directory #6724: "feat(session): filter sessions by current directory"
    • feat(session): filter sessions by current directory #6724
    • This appears to address the same core feature: filtering sessions by the current directory

This PR seems to have already attempted to solve the session filtering issue. You should check if PR #6724 is still open or if it was closed/merged, as the current PR #8886 may be re-implementing or completing the same functionality.

All other search results either returned the current PR itself (#8886) or unrelated features.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jan 21, 2026
[FEATURE]: Filter TUI session list by current directory/worktree #9881
Closed
session list is showing all sessions not only the ones scopes to the curent dir #8836
Closed
@allisoneer

allisoneer commented Jan 21, 2026

Copy link
Copy Markdown

This is from Claude:

Thanks for working on this! I noticed this PR only filters at the UI display level in the session list dialog. There are a few other entry points where cross-directory sessions can still leak through:

  1. Bootstrap fetch (sync.tsx:334-336) - The initial session.list call doesn't pass a directory filter, so all sessions are still fetched on TUI startup
  2. Real-time events (sync.tsx:208-220) - session.updated SSE events are inserted unconditionally, so sessions created/updated in other directories will appear
  3. Session search - The search query in this same file (line 29) doesn't pass directory either

The API already supports GET /session?directory=<path> filtering - it just needs to be wired up in these places too. Would you be open to expanding this PR to cover those cases? Or I can submit a separate PR with a more complete fix if you prefer.

See my comment on #8836 for more details on the approach.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jan 21, 2026
The sessions list seems to show all history, not the sessions history of the working directory #6098
Closed
Sessions are now mixed with home directory session list, disregarding which directory you're in #3551
Closed
@github-actions github-actions Bot mentioned this pull request Jan 21, 2026
feat(conatus): Implement Persistent Lab Sessions #9893
Closed
@thdxr
thdxr force-pushed the dev branch from cbab81f to 2d3c7a0 Compare January 30, 2026 04:50
@opencode-agent
opencode-agent Bot force-pushed the dev branch from 00637c0 to 71e0ba2 Compare January 30, 2026 14:32
@thdxr
thdxr force-pushed the dev branch 3 times, most recently from f1ae801 to 08fa7f7 Compare January 30, 2026 14:37
@github-actions github-actions Bot mentioned this pull request Feb 3, 2026
fix: filter CLI sessions by current directory for worktree support #12008
Closed
@Aegis-commits Aegis-commits mentioned this pull request Feb 20, 2026
fix(session): scope session list to current directory #14443
Closed
This was referenced Feb 20, 2026
fix(session): scope session list and TUI to current directory #14489
Closed
feat(cli): add -a global mode for session list #15178
Closed
@github-actions

github-actions Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

session list is showing all sessions not only the ones scopes to the curent dir

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@shoaibansari5398 @allisoneer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.