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
Can't change path for if session location unavailible #61085
I constantly move my work directories for different places. And i always get this issue on screenshots. Can you make changing work directories straightforward ?
changed the title [-]Cant' change path for if session location unavailible[/-][+]Can't change path for if session location unavailible[/+]on Nov 1, 2026
Thanks for the report and screenshots. I could reproduce this on 2.2.4, and it still happens on the latest dev (97a71f0).
What I did:
Created a git project, opened it in OpenCode and sent a message.
Quit OpenCode and moved the project folder somewhere else.
Reopened OpenCode and opened the session from /sessions (all projects). It showed Session location unavailable – Choose another directory to continue this session.
Choose directory only opens the Worktrees list for the project. That list only has the old, missing folder (in your case it was empty), and there's no way to pick or type the folder's new location.
Creating a new worktree from there fails with Creating workspace failed – Worktree directory unavailable: <old folder>, because it's created from the folder that no longer exists.
So once a project folder has moved, the TUI gives no way to point the session at its new location, even though the panel says you can choose another directory. The recording and screenshots below show this, and the script below reproduces it.
// Repro for anomalyco/opencode#61085: after a session's project folder is moved and// OpenCode is restarted, "Choose directory" offers only worktrees of the missing// project, and creating one fails, so the session can't be pointed at the new folder.//// Run: OPENCODE_DRIVE_DB=restart.sqlite OPENCODE_DRIVE_MEDIA_DIR=/workspace/media \// opencode-drive start --name issue-61085 --script ./drive.ts [--dev /path/to/opencode]import{execSync}from"node:child_process"import{mkdirSync,renameSync,rmSync,writeFileSync}from"node:fs"import{defineScript,Effect,Llm}from"opencode-drive"constbase="/tmp/opencode/issue-61085"constoriginal=`${base}/my-project`constmoved=`${base}/my-project-moved`exportdefaultdefineScript({launch: "manual",project: {git: true},run: ({ server, tuis, llm })=>Effect.gen(function*(){yield*Effect.sync(()=>{rmSync(base,{recursive: true,force: true})mkdirSync(original,{recursive: true})writeFileSync(`${original}/README.md`,"hello\n")execSync("git init -q && git add . && git -c user.email=a@b -c user.name=a commit -qm init",{cwd: original})})yield*server.launch()constfirst=yield*tuis.launch("first",{recording: true,keypressOverlay: true})constui=first.ui// 1. Switch to the project and start a session there.yield*Effect.sleep(2000)yield*ui.type(`/cd ${original}`)yield*Effect.sleep(800)yield*ui.enter()// accept the autocompletionyield*Effect.sleep(500)yield*ui.enter()// run /cdyield*ui.waitFor("my-project",{timeout: 10000})yield*Effect.sleep(1000)yield*llm.queue(Llm.text("Hi from the original folder."))yield*ui.submit("hello")yield*ui.waitFor("Hi from the original folder.")yield*ui.screenshot("01-session")yield*Effect.sleep(1000)yield*first.close()// 2. Quit OpenCode (TUI and server) and move the project folder.yield*server.kill()yield*Effect.sync(()=>renameSync(original,moved))// The resumed turn after restart may issue one more model request.yield*llm.queue(Llm.text("ok"))yield*server.launch()// 3. Reopen OpenCode and open the session from /sessions (all projects).constsecond=yield*tuis.launch("second",{recording: true,keypressOverlay: true})constui2=second.uiyield*Effect.sleep(2500)yield*ui2.type("/sessions")yield*Effect.sleep(800)yield*ui2.enter()yield*Effect.sleep(1500)yield*ui2.press("a",{ctrl: true})// all projectsyield*ui2.waitFor("Hi from the original folder.",{timeout: 10000})yield*Effect.sleep(800)yield*ui2.enter()yield*Effect.sleep(6000)yield*ui2.waitFor("Session location unavailable",{timeout: 20000}).pipe(Effect.tapError(()=>ui2.screenshot("03-debug")),)yield*Effect.sleep(800)yield*ui2.screenshot("03-location-unavailable")// 4. "Choose directory" -> only a Worktrees list; no way to pick the moved folder.yield*ui2.enter()yield*ui2.waitFor("Worktrees",{timeout: 10000})yield*Effect.sleep(2000)yield*ui2.screenshot("04-worktrees")// 5. Creating a new worktree fails because the source folder is gone.yield*ui2.press("a",{ctrl: true})yield*ui2.waitFor("Name worktree",{timeout: 10000})yield*ui2.type("fresh")yield*ui2.enter()yield*ui2.waitFor("Creating workspace failed",{timeout: 15000})yield*Effect.sleep(800)yield*ui2.screenshot("05-create-failed")yield*Effect.sleep(1500)}),})
Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH.
Plan: reproduce the TUI dead-end (a moved project folder leaves the session at "Session location unavailable", and "Choose directory" only lists the old worktree, so there is no way to point the session at its new location). Then I'll add a "Type a directory" recovery option to that panel which moves the session to the typed path through the existing session.move endpoint — the web panel already offers a directory picker for the same situation — plus a TUI regression test for typed-path recovery. I'll run the prompt-move TUI tests and the tui typecheck before opening the PR.
Closing as a duplicate of #55035: no way to repoint a session whose location is unavailable. Please follow that issue for updates and add any extra details there.
Activity
[-]Cant' change path for if session location unavailible[/-][+]Can't change path for if session location unavailible[/+]opencodejr commentedon Nov 1, 2026
Thanks for the report and screenshots. I could reproduce this on 2.2.4, and it still happens on the latest
dev(97a71f0).What I did:
/sessions(all projects). It showed Session location unavailable – Choose another directory to continue this session.Creating workspace failed – Worktree directory unavailable: <old folder>, because it's created from the folder that no longer exists.So once a project folder has moved, the TUI gives no way to point the session at its new location, even though the panel says you can choose another directory. The recording and screenshots below show this, and the script below reproduces it.
Related issues:
Worktree directory unavailablerecording.mp4
Reproduction script (drive.ts)
Run it with opencode-drive:
opencode-drive run ./drive.ts. It drivesopencodefrom yourPATH.jimmyallinai commentedon Nov 1, 2026
I'll take this one.
Plan: reproduce the TUI dead-end (a moved project folder leaves the session at "Session location unavailable", and "Choose directory" only lists the old worktree, so there is no way to point the session at its new location). Then I'll add a "Type a directory" recovery option to that panel which moves the session to the typed path through the existing session.move endpoint — the web panel already offers a directory picker for the same situation — plus a TUI regression test for typed-path recovery. I'll run the prompt-move TUI tests and the tui typecheck before opening the PR.
neriousy commentedon Nov 23, 2026
Closing as a duplicate of #55035: no way to repoint a session whose location is unavailable. Please follow that issue for updates and add any extra details there.