anomalyco / anomalyco/opencode
bug(core): empty git repos share the same "global" project ID, causing sessions to leak across unrelated directories
@nexxeln is already working on this.
Since Jul 31, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When opencode runs inside a Git repository that has no commits and no remote, project resolution falls back to project_id = "global" for ALL such repos. This causes session.list to return sessions from completely unrelated directories.
For example, repos at:
/home/user/testing (empty repo)
/home/user/projeto-a (empty repo)
/home/user/Área de trabalho/teste_Engram (empty repo)
all get project_id = "global". When you open /sessions in any of them, you see sessions from all of them mixed together because listByProject filters only by project_id, not by directory.
Expected: each directory/repo should have its own project identity (or at least sessions should be scoped by directory when project_id is global).
Plugins
No response
OpenCode version
1.18.10
Steps to reproduce
mkdir -p /tmp/repo-a /tmp/repo-bcd /tmp/repo-a && git init && opencode# starts TUI- In another terminal:
cd /tmp/repo-b && git init && opencode - Create a session in repo-a (e.g. "session from A")
- Create a session in repo-b (e.g. "session from B")
- In either TUI, type /sessions
→ Both "session from A" and "session from B" appear
Screenshot and/or share link
No response
Operating System
Fedora Linux 44 (KDE Plasma Desktop Edition) x86_64
Terminal
Konsole
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.