Uh oh!
There was an error while loading. Please reload this page.
fix(project): repair split project IDs across worktrees - #14287
fix(project): repair split project IDs across worktrees#14287benoitheinrich wants to merge 2 commits into
Conversation
benoitheinrich
commented
Feb 19, 2026
Updated the PR description to match the PR template sections. |
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
benoitheinrich
commented
Feb 19, 2026
CI note: the only failing check is The Windows log shows failures in prompt e2e tests with Bun reporting missing I don't see the project repair running in that job (no "Found duplicate projects" output), so this looks unrelated to the project-id/worktree changes. Would appreciate a rerun of the Windows e2e check. |
benoitheinrich
commented
Feb 19, 2026
Added a test to assert returns the same when called from the repo root vs any git worktree path (: ). Commit bc711ab1b. |
benoitheinrich
commented
Feb 19, 2026
Added a test to assert Commit: bc711ab1b |
benoitheinrich
commented
Feb 19, 2026
I manually validated the one-time repair path locally. Command:
Observed output: |
Added coverage for the Commit: 17c9e1b7d |
a0afa70 to
a7a1c19Compareb072ed4 to
d9d9dceComparebenoitheinrich
commented
Feb 20, 2026
@adamdotdevin any chance to get this PR reviewed soon ? thanks 😄 |
cfa9cb4 to
7d1804cCompareFinding: separate clones were collidingWhile fixing #14082 (worktrees splitting project IDs), we noticed another scenario: two separate clones of the same git repo can end up sharing a project identity if the ID is derived from repo history (eg. root commit). In the UI this shows up as selecting one project selecting both. Fix
|
Update: clone + worktree collision fixedWe found a second failure mode beyond #14082 (worktree split-brain): if the git project id is derived from repo history (legacy 40-hex root commit), separate clones of the same repo collide and the UI can treat them as the same project (selecting one selects both). Here is how it looks like, the V icon is selected twice: ![]() Fix
CoverageAdded regression tests for:
CI is green on the latest push. |
benoitheinrich
left a comment
There was a problem hiding this comment.
All is good for me, can this be merged ?
benoitheinrich
commented
Mar 5, 2026
51e3c1b to
5108464Comparenicolas-bourdeau
commented
Aug 18, 2026
any update on this issue ? soon to be released ? thanks |



Issue for this PR
Closes#14082
Type of change
What does this PR do?
When using git worktrees/sandboxes, the same repo can end up with multiple OpenCode
project.idvalues for a singleproject.worktree. That splits sessions (and other project-scoped data) across IDs. In the Web UI with workspaces enabled this shows up as empty session lists for some sandboxes (/session?directory=<sandbox>&roots=true...) even though sessions exist.This PR:
vcs='git'project row.How did you verify your code works?
cd packages/opencode && bun test test/project/project.test.tsproject.currentresolves to the same project id for root and sandbox directories./session?directory=<sandbox>&roots=true...returns the expected sessions.Screenshots / recordings
N/A (backend-only change)
Checklist