fix: list all sessions regardless of git context (#15678)#15733
fix: list all sessions regardless of git context (#15678)#15733zoe531 wants to merge 1 commit intoanomalyco:devfrom
Conversation
Use Session.listGlobal instead of Session.list to show all sessions regardless of current project/git context.
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search results, I found one potentially related PR: Related PR:
The searches also returned #15733 (the current PR itself) and #13960 "fix: scope session list and children to current worktree" which is about scoping to worktrees rather than making sessions global. The most relevant is #15178 since both PRs deal with the ability to view all sessions regardless of context, though they take different approaches (your PR makes it the default behavior vs. that PR adds an optional flag). |
|
Hi, I have resubmitted this fix. The fix changes Local tests pass: Could you please review? Thank you! |
|
Friendly bump! This fix is ready for review. Thank you! |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Issue for this PR
Closes #15678
Type of change
What does this PR do?
Fixes issue #15678 where
opencode session listreturns empty results when run inside a Git repository.The bug was caused by using
Session.list()which filters by current project ID. When running inside a Git repo, it only shows sessions for that specific project. Changed toSession.listGlobal()which shows all sessions regardless of current project/git context.How did you verify this code works?
Analyzed the code and confirmed:
Session.list()filters byproject.id- causes the bugSession.listGlobal()does not filter by project - fixes the bugLocal tests pass:
Screenshots / recordings
N/A - This is a CLI fix, no UI changes.
Checklist