You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sessions break when their folder is renamed outside opencode #56270
Renaming a project folder outside opencode orphans its sessions. They fail with LocationNotFoundError on update and there is no repair path in the product.
Environment
opencode version: 2.0.31 (service 2.0.30)
OS: Linux 7.2.10-200.fc44.x86_64 (linux x64)
Terminal: foot, /bin/bash
Install/channel: latest
Active plugins: none found in config
Reproduction
Create a session in /home/user/Documents/myproject.
Rename the folder in a file manager to /home/user/Documents/myproject-v2.
Try to continue or rename the session via the API.
Expected Behavior
opencode detects the folder moved and offers to re-point the session and project, or migrates the stored paths automatically.
Actual Behavior
Session updates fail with LocationNotFoundError. Recovery requires hand-editing opencode.db rows across session_v2, project, project_directory, and worktree tables. Stale project rows can also resurrect on restart from orphaned worktree entries.
Additional Context
Consistently reproducible. Worked around with a local skill that runs session.move after every rename, but this belongs in the product.
Thanks for the detailed report! I think this is a duplicate of #44256, which asks for the same thing: when a project folder is renamed or moved, detect it and re-link the sessions and project to the new path instead of leaving them orphaned. It's still open, and there is already a proposal there to implement it in v2.
Possible duplicates and related issues, ordered from most to least likely:
Until that lands, session.move (which you already use) and the "Session location unavailable" prompt's option to move the session are the supported ways to repoint a session.
If you can reproduce the stale project rows coming back on restart from orphaned worktree entries, please open a separate issue with the steps.
The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
Closing this as a duplicate of #44256, since there's been no reply in the past day. #44256 asks for the same thing: detect when a project folder is renamed or moved and re-link its sessions and project to the new path. Please follow and add to that issue.
Until then, session.move or the move option in the "Session location unavailable" prompt can repoint a session. If you can reproduce stale project rows coming back on restart from orphaned worktree entries, please open a new issue with the steps. If this issue is different from #44256, reply here and explain how.
Activity
opencode-agent commentedon Oct 16, 2026
Thanks for the detailed report! I think this is a duplicate of #44256, which asks for the same thing: when a project folder is renamed or moved, detect it and re-link the sessions and project to the new path instead of leaving them orphaned. It's still open, and there is already a proposal there to implement it in v2.
Possible duplicates and related issues, ordered from most to least likely:
project.worktree; reported on 1.18.30 Desktop, but may relate to the stale project rows you mentionUntil that lands,
session.move(which you already use) and the "Session location unavailable" prompt's option to move the session are the supported ways to repoint a session.If you can reproduce the stale project rows coming back on restart from orphaned
worktreeentries, please open a separate issue with the steps.The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
opencode-agent commentedon Oct 17, 2026
Closing this as a duplicate of #44256, since there's been no reply in the past day. #44256 asks for the same thing: detect when a project folder is renamed or moved and re-link its sessions and project to the new path. Please follow and add to that issue.
Until then,
session.moveor the move option in the "Session location unavailable" prompt can repoint a session. If you can reproduce stale project rows coming back on restart from orphanedworktreeentries, please open a new issue with the steps. If this issue is different from #44256, reply here and explain how.