Repository navigation
Description
When a project is moved/renamed on disk (e.g. /home/user/old-project → /home/user/new-location), all existing sessions that reference the old path via the session.directory column in ~/.local/share/opencode/opencode.db become unusable. Opening such a session shows the conversation history, but sending any prompt immediately produces "Build · · interrupted" with no error message visible to the user.
The log shows level=ERROR message=process session.id=... error=Aborted stack=undefined, but no indication that the stale directory path is the cause.
Probable root cause:
The session's directory field in the SQLite database stores the absolute path that was current at session creation time. When opencode loads a session:
- It sets the working directory from
session.directory - The snapshot tracking system, file watcher, and file-picker (
fff) all operate relative to this path - If the path doesn't exist, the LLM turn is silently aborted
The same issue has been observed to affect:
project.worktree: project-level worktree pathproject_directory.directory: registered project directoriessnapshot/<id>/<epoch>/config: snapshot git configworktree = ...snapshot/<id>/<epoch>/objects/info/alternates: alternates path to main repo's.git/objects- DCP plugin storage files (
~/.local/share/opencode/storage/plugin/dcp/*.json): compressed summaries containing old paths
Impact
- No visual feedback to the user about why the session fails
- All sessions for the moved project broke
- Users with many sessions (100+) must manually update each row in the DB
- Also affects the file-picker (
fff) which logs "Failed to init file picker: Invalid path" but doesn't block session loading
Plugins
@tarquinen/opencode-dcp@latest
OpenCode version
1.17.10
Steps to reproduce
To Reproduce
- Create a test repo:
mkdir -p /tmp/opencode-test && cd /tmp/opencode-test git init && echo "test" > README.md && git add . && git commit -m "init"
- Create a session:
opencode run "hello" --dir /tmp/opencode-test --dangerously-skip-permissions - Get the session ID:
sqlite3 ~/.local/share/opencode/opencode.db
"SELECT id FROM session WHERE directory = '/tmp/opencode-test';" - Move the repo (simulating a project move):
mv /tmp/opencode-test /tmp/opencode-test-moved - Try to continue the session from the new location:
opencode run "hello again" --session --dir /tmp/opencode-test-moved
Result: The command hangs indefinitely (timed out after 60s). The log shows:
- "creating instance" directory=/tmp/opencode-test (old path, --dir flag ignored)
- "loop session.id=... step=0" (session loads)
- "failed to initialize fff" error="Failed to init file picker: Invalid path /tmp/opencode-test"
- No stream ever starts — the session hangs at step 0
- The --dir flag does not override the session's stored directory
Screenshot and/or share link
No response
Operating System
Debian 6.12.94-1
Terminal
gnome-terminal
Activity
github-actions commentedon Jun 25, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
--dirignored when attaching to specific session #33357:--dirignored when attaching to specific session (matches the specific symptom where--dirflag does not override the session's stored directory)If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Jun 25, 2026
Thank you for updating the issue! It now meets our contributing guidelines and has everything we need: clear description, detailed reproduction steps, system information, and version details. We've removed the compliance flag.
github-actions commentedon Aug 25, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
Hona commentedon Sep 2, 2026
Fixed for opencode2 launch via #46713
You can try the desktop beta here: https://github.com/anomalyco/opencode-beta