anomalyco / anomalyco/opencode
Desktop: project folders created by the agent during chat never appear in the project list
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
What happened
While chatting in the desktop app, I asked the agent to set up a new project for me: a brand-new directory with its own opencode.json and a custom primary agent under .opencode/agent/. The agent created everything correctly on disk and the project works fine (verified via CLI and the HTTP API), but the new project never appeared in the desktop app's sidebar project list, even after restarting the app. The only way to open it was to add the folder manually through the project picker.
Why this is confusing
From the user's perspective, the project was created through the app, by the app's own agent, so the app already "knows" it exists. Having to manually add the folder afterwards feels like something went wrong, when nothing did. My first assumption was that the agent had failed to create or configure the project.
Details from investigating
- The sidebar list is app-side state in
%APPDATA%\ai.opencode.desktop\opencode.global.dat(server.projects.local), and it is only populated when a project is opened through the UI. - Projects known to the CLI (
~/.local/share/opencode/opencode.db) are not reflected in the desktop list either. I verified this directly: after runningopencode serveinside the new directory (which registered the project in the CLI storage), the desktop app still did not show it after a restart.
Suggestion
When the agent, during a desktop chat session, creates a new directory that contains opencode config (opencode.json, .opencode/), the desktop app should either:
- automatically add that directory to
projects.local, or - surface a prompt/notification such as "The agent created project X. Open it?"
Option 2 is probably the safer default, since it asks for consent before changing the user's context.
Possibly related: #26207 (sidebar state in opencode.global.dat not being updated).
Environment
- opencode desktop 1.18.18 on Windows 10
- CLI (npm) 1.2.27
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.
Research direction
Start by tracing how the desktop sidebar reads and updates server.projects.local in %APPDATA%\ai.opencode.desktop\opencode.global.dat, then compare that with project creation during a desktop chat. Check how the project picker adds folders and how the CLI records projects in ~/.local/share/opencode/opencode.db. Done means a project created by the agent is either added safely to the sidebar or surfaced with an open prompt.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100