You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
session list is showing all sessions not only the ones scopes to the curent dir #8836
Changes Session.list() default behavior for ALL clients (web UI, API consumers, CLI)
Requires new --all flag and ?all=true query param for opt-out
More invasive change that affects the API contract
Web UI and other consumers may want cross-directory visibility by default
Proposed Alternative: TUI-only, use existing API
The API already supports GET /session?directory=<path> (exact match filter) - it's just never wired up in the TUI. A more complete TUI-only fix would:
Pass directory param to bootstrap session.list call in sync.tsx
Pass directory param to session search in dialog-session-list.tsx
Filter session.updated real-time events by directory (early break if mismatch)
Pass directory: cwd to tui() call for SDK context
Why this approach?
Uses existing API infrastructure (no server changes, no new flags)
Filters ALL entry points: bootstrap, search, AND real-time events
No behavior change for web UI or other API consumers
Purely additive - doesn't change any defaults or require opt-out mechanisms
Known limitation: Uses exact directory match (existing API behavior). Sessions created from a subdirectory won't appear when TUI is launched from repo root. This is acceptable for the worktree use case and could be improved later with prefix matching if needed.
I have a working implementation of this approach and happy to submit a PR if maintainers prefer this direction over the existing PRs.
I have the same issue when working with worktrees. When using the --continue flag, it resumes the last session in whatever worktree. Ideally it would resume the session in that particular worktree.
Is this a git project? because in git projects it is scoped, everything else is global
Hi @rekram1-node, I am having the same issue because of git worktrees. I am available to work on this if you can provide some instructions regarding where the fix should be. Should the fix be on the server and affect all clients or should this be a fix only for the TUI ? Let me know and I can provide a PR.
Would there be any interest in PRs to make the scoping configurable? In my use case at least, I want a separate session list per worktree rather than a global one for the entire git repo. I tend to use a worktree to contain a particular thread of work so scoping them that way is much more clear for my workflow. I'm sure others might want it directory scoped or have other ideas.
Happy to file an issue and a PR if that sounds desirable more broadly.
On Tue, Mar 17, 2026 at 1:29 PM Ethan J. Jackson ***@***.***> wrote:
*ejj* left a comment (anomalyco/opencode#8836)
<#8836 (comment)>
Would there be any interest in PRs to make the scoping configurable? In my
use case at least, I want a separate session list *per worktree* rather
than a global one for the entire git repo. I tend to use a worktree to
contain a particular thread of work so scoping them that way is much more
clear for my workflow. I'm sure others might want it directory scoped or
have other ideas.
Happy to file an issue and a PR if that sounds desirable more broadly.
—
Reply to this email directly, view it on GitHub
<#8836 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHFYE5BNLG2WGQJSDJBPZL4RGRRBAVCNFSM6AAAAACR4MI7QCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DANZXGQ4TENBZHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
Adding a current reproduction from OpenCode 1.15.9 because this still affects the new OPENCODE_EXPERIMENTAL=1 + /warp worktree workflow.
Steps:
Launch OpenCode in a git repo with multiple worktrees/workspaces.
Use /warp to switch between worktrees.
Open /sessions from each worktree.
Actual: sessions from all worktrees for the same git project are mixed together.
Expected: the TUI defaults to sessions for the current workspace/worktree, with a visible "show all" escape hatch or filter indicator so users do not think sessions disappeared.
Why this matters: a worktree is usually one isolated thread of work. Mixing sessions across worktrees defeats the main reason to use /warp in the terminal, especially now that the web UI already makes workspace-specific sessions feel separate.
The existing API/schema looks like it has enough metadata to support this without changing project identity: sessions expose directory and workspaceID, and session list endpoints accept workspace/path-style filters. So the useful fix seems to be TUI scoping/UX rather than changing projectID.
Activity
github-actions commentedon Jan 16, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
fix(tui): scope session list to current directory (anomalyco#8836)
allisoneer commentedon Jan 21, 2026
This is from Claude:
I've done some research on this issue and wanted to share findings on the existing PRs and a potentially more complete approach.
Existing PR Analysis
PR #8886 (client-side filtering in dialog only):
session.updatedevents (cross-directory sessions can still appear via SSE)PR #6724 (server-side default filtering):
Session.list()default behavior for ALL clients (web UI, API consumers, CLI)--allflag and?all=truequery param for opt-outProposed Alternative: TUI-only, use existing API
The API already supports
GET /session?directory=<path>(exact match filter) - it's just never wired up in the TUI. A more complete TUI-only fix would:directoryparam to bootstrapsession.listcall insync.tsxdirectoryparam to session search indialog-session-list.tsxsession.updatedreal-time events by directory (early break if mismatch)directory: cwdtotui()call for SDK contextWhy this approach?
Known limitation: Uses exact directory match (existing API behavior). Sessions created from a subdirectory won't appear when TUI is launched from repo root. This is acceptable for the worktree use case and could be improved later with prefix matching if needed.
I have a working implementation of this approach and happy to submit a PR if maintainers prefer this direction over the existing PRs.
rekram1-node commentedon Jan 21, 2026
Is this a git project? because in git projects it is scoped, everything else is global
allisoneer commentedon Feb 5, 2026
It is a git project! I want scoped to each worktree in that git project instead of just scoped to the git project as a whole.
alexprudhomme commentedon Feb 5, 2026
I have the same issue when working with worktrees. When using the --continue flag, it resumes the last session in whatever worktree. Ideally it would resume the session in that particular worktree.
alexprudhomme commentedon Feb 5, 2026
Hi @rekram1-node, I am having the same issue because of git worktrees. I am available to work on this if you can provide some instructions regarding where the fix should be. Should the fix be on the server and affect all clients or should this be a fix only for the TUI ? Let me know and I can provide a PR.
fix(session): scope session list to current directory
fix(session): scope session list to current directory
ejj commentedon Mar 17, 2026
Would there be any interest in PRs to make the scoping configurable? In my use case at least, I want a separate session list per worktree rather than a global one for the entire git repo. I tend to use a worktree to contain a particular thread of work so scoping them that way is much more clear for my workflow. I'm sure others might want it directory scoped or have other ideas.
Happy to file an issue and a PR if that sounds desirable more broadly.
luisrudge commentedon Mar 17, 2026
marcodiniz commentedon Mar 19, 2026
Also an issue for me. If at least it could show the working dir for the session in the session list, what would help
fix: resolve unique project IDs for git submodules
rodrigojimenezdencker commentedon May 22, 2026
Adding a current reproduction from OpenCode 1.15.9 because this still affects the new
OPENCODE_EXPERIMENTAL=1+/warpworktree workflow.Steps:
/warpto switch between worktrees./sessionsfrom each worktree.Actual: sessions from all worktrees for the same git project are mixed together.
Expected: the TUI defaults to sessions for the current workspace/worktree, with a visible "show all" escape hatch or filter indicator so users do not think sessions disappeared.
Why this matters: a worktree is usually one isolated thread of work. Mixing sessions across worktrees defeats the main reason to use
/warpin the terminal, especially now that the web UI already makes workspace-specific sessions feel separate.The existing API/schema looks like it has enough metadata to support this without changing project identity: sessions expose
directoryandworkspaceID, and session list endpoints accept workspace/path-style filters. So the useful fix seems to be TUI scoping/UX rather than changingprojectID.github-actions commentedon Jul 22, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.