fix: list all sessions regardless of git context (#15678)#15772
fix: list all sessions regardless of git context (#15678)#15772zoe531 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.
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: Related PR:
However, PR #15178 and PR #15772 (current PR) appear to address the same underlying issue from different angles - one adds a flag option while the current PR changes the default behavior to always list globally. No other duplicate PRs found that directly address the same fix. |
|
it's a feature, not bug |
|
Friendly bump! This fix is ready. Please review. Thank you! |
zoe531
left a comment
There was a problem hiding this comment.
This fix is ready. Please review.
|
@adiled if this is a feature, is there a way to revert this change by showing all sessions regardless of context in a config file or something? This is painful for those who work multi-repos and start opencode in a common workspace folder UPDATE: I think my issue is different, Created a PR and a related issue for it #16273 |
Issue for this PR
Closes #15678
Type of change
What does this PR do?
Fixes issue #15678 where opencode session list returns 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 to Session.listGlobal() which shows all sessions regardless of current project/git context.
How did you verify your code works?
Analyzed the code and confirmed the fix works.
Local tests pass:
test/server/session-list.test.ts: 5 pass
Screenshots / recordings
N/A
Checklist