Uh oh!
There was an error while loading. Please reload this page.
fix(opencode): recover projects moved to a new path - #38584
Conversation
#35311 is a much better solution than this. |
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#38578
Type of change
What does this PR do?
When a Git repository moved, the stored project kept the missing original path
as its primary worktree and tracked the live path as a sandbox. Desktop startup
could therefore request the deleted path first, causing Git discovery to fail
in
FileSystem.realPathbefore the existing project record could be repaired.This change recovers the project at both boundaries:
surviving sandbox;
context, so the stale and current requests share one valid instance;
database migration;
directory, including their relative
path, without changingtime_updated; andRecovery is intentionally conservative: it only redirects a missing primary
worktree when exactly one recorded sandbox still exists. Existing behavior is
unchanged when the primary worktree exists or multiple live sandboxes make the
replacement ambiguous.
How did you verify your code works?
The regression tests create a Git repository, seed project and legacy-global
sessions plus a workspace, move the repository, and then request the deleted
path. They verify:
Executed:
Screenshots / recordings
Not applicable; this is a project/session persistence and instance-routing fix
with no UI changes.
Checklist