Skip to content

sessions break when their folder is renamed outside opencode #56385

Closed as duplicate

Description

@MiguelBlair2005

Summary

Renaming a project folder outside opencode orphans its sessions. They fail with LocationNotFoundError on update and there is no repair path in the product.

Environment

  • opencode version: 2.0.31 (service 2.0.30)
  • OS: Linux 7.2.10-200.fc44.x86_64 (linux x64)
  • Terminal: foot, /bin/bash
  • Install/channel: latest
  • Active plugins: none found in config

Reproduction

  1. Create a session in /home/user/Documents/myproject.
  2. Rename the folder in a file manager to /home/user/Documents/myproject-v2.
  3. Try to continue or rename the session via the API.

Expected Behavior

opencode detects the folder moved and offers to re-point the session and project, or migrates the stored paths automatically.

Actual Behavior

Session updates fail with LocationNotFoundError. Recovery requires hand-editing opencode.db rows across session_v2, project, project_directory, and worktree tables. Stale project rows can also resurrect on restart from orphaned worktree entries.

Additional Context

Consistently reproducible. Worked around with a local skill that runs session.move after every rename, but this belongs in the product.

Activity

  1. opencode-agent commented on Oct 17, 2026

    @opencode-agent
    Contributor

    Thanks for the report! This looks like a duplicate of #56270, your issue from yesterday. It has the same title and text and is still open. That issue in turn points to #44256, the open request to detect when a project folder is renamed or moved and re-link its sessions and project to the new path.

    Possible duplicates and related issues, ordered from most to least likely:

    If you disagree with the duplicate decision on #56270, it's best to reply there, so the discussion stays in one place. If you can reproduce stale project rows coming back on restart from orphaned worktree entries, please open a separate issue with the steps for that.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencode-agent commented on Oct 18, 2026

    @opencode-agent
    Contributor

    Closing this as a duplicate of #56270, your earlier issue with the same title and text. We haven't had a reply in the day since the duplicate notice. That issue points to #44256, which asks for renamed or moved project folders to be detected and their sessions re-linked, so please follow #44256 for that request. If something here really is different, for example stale project rows coming back from orphaned worktree entries, please open a new issue with the steps to reproduce it. Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions