fix: list all sessions regardless of git context (#15678)#15716
fix: list all sessions regardless of git context (#15678)#15716zoe531 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, I found one potentially related PR: Related PR:
This PR (#15716) appears to be the primary fix for issue #15678, with no exact duplicates found. The change directly addresses the root cause by switching from project-scoped session listing to global session listing by default. |
|
"Thank you @zoe531 for the rapid response and for implementing the global list fix! Switching to Session.listGlobal() perfectly addresses the root cause I identified regarding the ProjectID shift during the initial Git commit. This change will significantly improve the experience for developers who iterate quickly from local ideas to Git repositories. Looking forward to seeing this merged!" |
|
Hi, I have updated the PR description to follow the template. Could you please re-review? The CI test failures (test linux, e2e windows) appear to be pre-existing issues unrelated to this fix (which only changes 2 lines of code - Session.list to Session.listGlobal). |
|
Update: The failing CI tests (test linux, e2e windows) appear to be pre-existing issues on the dev branch, not caused by this change. This PR only modifies 2 lines of code (Session.list -> Session.listGlobal). Could a maintainer please review and potentially approve despite the compliance label? Thank you! |
|
Update: Local tests pass ✅ All tests pass locally. Please 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 that:
Session.list()filters byproject.id- causes the bugSession.listGlobal()does not filter by project - fixes the bugScreenshots / recordings
N/A - This is a CLI fix, no UI changes.
Checklist