Skip to content

Cannot delete projects or sessions; deleting the project folder and recreating a same-named folder brings back old sessions #41068

Closed as not planned

Description

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

On the OpenCode desktop app (Windows 11, v1.18.15), I cannot delete a project or a session from the UI (right-click has no delete option / delete does nothing).

I tried to work around it by manually deleting the project folder on disk (after quitting the app), but after recreating a folder with the same name, the old sessions for that project reappear in the project's session list, as if they were still stored somewhere outside the project folder (probably keyed by project name/path rather than an ID).

This is a follow-up of #39999 (closed as not_planned without a response) — the problem still exists.

Suggested behavior

  • Add a delete option for projects and sessions in the desktop UI (right-click menu / settings page).
  • Session data should not be tied to the folder name; deleting the folder or recreating a same-named folder should not resurrect old sessions.

Environment

  • OS: Windows 11
  • App: OpenCode Desktop v1.18.15

Activity

  1. github-actions commented on Aug 7, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. liudongyan13701205717-source commented on Aug 8, 2026

    @liudongyan13701205717-source
    Author

    Confirming overlap with #31401 (already tracked, assigned to Hona): the "recreating a same-named folder brings back old sessions" part is exactly #31401. I've added fresh 1.18.15 reproduction details there so the data lives on the officially tracked issue.

    The UI-level "no delete option for sessions/projects" part of this report overlaps #40786 / #33129 / #38771 — worth keeping those open for the UX-side fix even if this one gets closed as duplicate. Tracking this issue here as the umbrella for both angles is fine.

  3. liudongyan13701205717-source commented on Aug 15, 2026

    @liudongyan13701205717-source
    Author

    Cross-link with #31401 (OpenCode keeps reopening deleted project path) — opposite sides of the same data-lifecycle bug: deleted projects/sessions aren't truly removed and resurface. Tracking together = the "project/session deletion is broken" umbrella. +1, still reproducible on Desktop.

  4. liudongyan13701205717-source commented on Oct 1, 2026

    @liudongyan13701205717-source
    Author

    This was generated by AI during triage.

    Reporting this as still reproducible on Desktop (1.18.x, Windows), and adding what I hit while working around it, since the workaround is the part that is hard to rediscover.

    The data is not in the project folder. Session/project state lives in the app's SQLite database at ~/.local/share/opencode/opencode.db (session, message, part, and a todo table). Deleting or recreating the project directory therefore cannot remove it, which is exactly why recreating a same-named folder resurfaces the old sessions. That confirms the #31401 half is the same bug, not a related one.

    Deleting the folder is not a workaround, and neither is clearing a cache — there is nothing in the folder to delete in the first place.

    What I did instead (unsupported, at your own risk). With the app fully quit, I deleted the rows directly, then verified after restart: the sessions did not come back and there were no orphaned message/part rows left behind. Two caveats stated plainly: the app must be closed or it holds the WAL and overwrites your work, and this is not a recommendation. It is the reason this issue matters — a UI that cannot remove its own data leaves users with no supported path at all, and they will keep rediscovering this.

    A possible unifying cause. Per @Chunai-Bboy's finding in #41359, SessionTodo has no client-side write path — the only writer is the todowrite tool. If sessions have the same property, that there is no client-side delete call and only the cascade that follows from the row being gone, then this issue and the stale-todo resurrection are two symptoms of one omission: the destructive half of the data lifecycle was never built, only the create half. If that is right, one fix covers both.

    Happy to test any fix on Desktop.

  5. bybpow commented on Oct 28, 2026

    @bybpow

    I can confirm this is still reproducible in OpenCode Desktop on Windows. In Settings → Projects, the project menu only offers Edit, Rename, Reveal in File Explorer, and Clear notifications. There is no option to remove or permanently delete a project. Reinstalling OpenCode also leaves the project entries visible.

    Please add a supported way to permanently remove a project record from OpenCode’s database, with clear behavior for its sessions and project files. Removing a project from OpenCode should not delete files from disk unless the user explicitly chooses that.

  6. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the follow-up and the clear description.

    You're on OpenCode Desktop v1.18.15, which is v1. v1 now only gets fixes for critical bugs (data loss, security problems, crashes with no workaround). Adding delete options and changing how sessions are linked to project folders is new behaviour rather than a critical fix, so it's unlikely to change in v1.

    Please try OpenCode v2 (the @opencode/cli package and the v2 desktop app), where active development happens. Related issues, most relevant first:

    If you see the same problem on v2, or think this is critical in v1 (for example, if it causes data loss), please reply here with the details.

  7. opencodejr commented on Oct 29, 2026

    @opencodejr
    Contributor

    I'm closing this as not planned. It was reported on OpenCode Desktop v1.18.15, and v1 only gets fixes for critical bugs. Delete options for projects and sessions, and old sessions coming back after a folder is recreated, aren't in that category.

    If the same thing happens on OpenCode v2, please open a new issue with your v2 version and steps to reproduce. #51197 tracks the related v2 request to remove projects. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions