fix(opencode): scope --continue to the current worktree directory - #33521
fix(opencode): scope --continue to the current worktree directory#33521markjaquith wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR that addresses similar session scoping concerns: Related PR:
However, this is not a duplicate—it's a related but distinct fix. PR #31210 focuses on non-git sessions while PR #33521 specifically addresses git worktrees for the No duplicate PRs found |
b8912b9 to
d690cbe
Compare
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Root-level git worktrees of the same repo all share an empty
project-relative path (""), so listByProject filtered root sessions by
project_id alone and --continue could resume another worktree's most
recently updated session.
Send the current absolute directory with the TUI session list query and,
when the project-relative path is empty, filter sessions by that
directory. Add a regression test with two real git worktrees asserting
the feature worktree's list excludes the main worktree's root session.
Closes anomalyco#25963
956ebb4 to
e17e6ab
Compare
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #25963
Type of change
What does this PR do?
Fixes the bug where
opencode --continuewould continue the wrong session if you were using worktreesRoot-level git worktrees of the same repo all share an empty project-relative path (""), so
listByProjectfiltered root sessions byproject_idalone and--continuecould resume another worktree's most recently updated session.This fix sends the current absolute directory with the TUI session list query and, when the project-relative path is empty, filters sessions by that directory. It also adds a regression test with two real git worktrees asserting the feature worktree's list excludes the main worktree's root session.
How did you verify your code works?
Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist
If you do not follow this template your PR will be automatically rejected.