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 shows empty despite sessions existing in storage (v0.14.6) #3026
This issue might be a duplicate of existing issues. Please check:
[Bug] All sessions are gone #2987: [Bug] All sessions are gone - Also involves session loss/visibility issues, specifically mentions sessions disappearing after running /compact command, which could be related to session loading problems in upgraded versions
Feel free to ignore if none of these address your specific case.
Possible fix approach:
All locations need Directory: opencode.F(a.Project.Worktree) added to params (where a.Project is available).
Note: Not sure why this worked in earlier versions - perhaps the server was launched from user's working directory previously, making process.cwd() fallback correct? Just trying to understand the regression context.
The TUI has never populated directory params in API calls (checked git history). It may have worked previously if the server's process.cwd() fallback happened to match the user's project directory.
Something may have changed in how/where the server process starts, causing process.cwd() to point elsewhere. This would explain why old sessions exist in storage but aren't visible - created under one project ID, looked up under another.
Just tested and confirmed /sessions works in NEW projects but not EXISTING ones.
Why this happens:
NEW projects often work by accident because the server's process.cwd() happens to match the project directory. EXISTING projects fail when these don't align.
The flow:
TUI calls API (no directory param)
→ Server defaults to process.cwd()
→ Instance caches project by that directory
→ Sessions looked up using wrong project ID
So the original fix still applies - TUI needs to pass directory parameter to ensure correct project context regardless of where the server started.
This bug also affects project-local skills discovery when using opencode attach.
When I run:
cd /home/me && opencode serve
cd /home/me/projects/my-app && opencode attach http://127.0.0.1:4096
The server discovers skills starting from /home/me (its own process.cwd()), not from /home/me/projects/my-app where the TUI is running.
According to the documentation (https://opencode.ai/docs/skills/):
"For project-local paths, OpenCode walks up from its current working directory until it reaches the git worktree."
Because the TUI doesn't pass the working directory to the server, skills discovery starts in the wrong directory and never finds:
Activity
github-actions commentedon Oct 8, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
randomm commentedon Oct 8, 2025
Update: More severe than version compatibility
Sessions created in v0.14.6 also don't appear in
/sessionslist.Test:
/sessions→ "No sessions available"Evidence:
Session listing appears completely broken, not just cross-version incompatibility.
rekram1-node commentedon Oct 8, 2025
@randomm ill send some debug commands shortly
rekram1-node commentedon Oct 8, 2025
So in the project that has no sessions anymore, if you run:
git rev-list --max-parents=0 --alldo you seede19ee09d010e956a30a119287a1b94f91b5cff2?randomm commentedon Oct 8, 2025
Root cause found:
The TUI doesn't pass the
directoryparameter when calling session list API.Code locations (v0.14.6):
packages/tui/internal/app/app.go:907:packages/opencode/src/server/server.ts:95:packages/opencode/src/session/index.ts:274:Issue:
SessionListParams{}(no directory)process.cwd()instead of user's working directorySame bug affects:
Session.New()(line 776)Session.Delete()(line 919)Project.Current()(main.go:75)Fix needed:
TUI should pass current directory in all API params, or SDK client should be configured with default directory.
randomm commentedon Oct 8, 2025
@rekram1-node Yes, confirmed:
The project ID matches exactly. Sessions exist in storage at the correct path with 32 parent sessions + 413 child sessions, but
/sessionsshows empty.randomm commentedon Oct 8, 2025
Additional Context (potentially helpful for fix)
Found 13 locations in TUI where
directoryparameter is not passed to API calls. All use empty params likeSessionListParams{}:main.go (initial setup):
ProjectCurrentParams{}AgentListParams{}PathGetParams{}EventListParams{}app.go (session operations):
ConfigGetParams{}CommandListParams{}AppProvidersParams{}SessionNewParams{}(affects session creation)SessionAbortParams{}SessionListParams{}(why /sessions shows empty)SessionDeleteParams{}(potentially dangerous)SessionMessagesParams{}Possible fix approach:
All locations need
Directory: opencode.F(a.Project.Worktree)added to params (wherea.Projectis available).Note: Not sure why this worked in earlier versions - perhaps the server was launched from user's working directory previously, making
process.cwd()fallback correct? Just trying to understand the regression context.Happy to provide more details if helpful!
randomm commentedon Oct 8, 2025
Possible explanation for regression
The TUI has never populated
directoryparams in API calls (checked git history). It may have worked previously if the server'sprocess.cwd()fallback happened to match the user's project directory.Something may have changed in how/where the server process starts, causing
process.cwd()to point elsewhere. This would explain why old sessions exist in storage but aren't visible - created under one project ID, looked up under another.Just a theory though - could be completely off!
randomm commentedon Oct 8, 2025
Hmm, stop press. /sessions works in new projects, but not in existing projects with many sessions. I will look into this more deeply to make sure now.
randomm commentedon Oct 8, 2025
Update: NEW vs EXISTING projects behavior
Just tested and confirmed
/sessionsworks in NEW projects but not EXISTING ones.Why this happens:
NEW projects often work by accident because the server's
process.cwd()happens to match the project directory. EXISTING projects fail when these don't align.The flow:
So the original fix still applies - TUI needs to pass
directoryparameter to ensure correct project context regardless of where the server started.I'll see if I can provide a PR for a fix.
fix(tui): pass directory parameter to all API calls
fix(tui): pass directory parameter to all API calls
randomm commentedon Oct 8, 2025
Unfortunately this still does not fix the issue on my local machine. Continuing debugging...
manascb1344 commentedon Jan 28, 2026
This bug also affects project-local skills discovery when using
opencode attach.When I run:
The server discovers skills starting from /home/me (its own process.cwd()), not from /home/me/projects/my-app where the TUI is running.
According to the documentation (https://opencode.ai/docs/skills/):
Because the TUI doesn't pass the working directory to the server, skills discovery starts in the wrong directory and never finds: