Skip to content

Bug: project_id cache collision across bare repos under shared parent directory #18045

Closed

Description

@StevenTCramer

Description

OpenCode can assign the same project_id to unrelated repositories when those repos are bare git dirs under the same parent directory (for example, multiple *.git repos under one org folder). This causes session history to mix across repos, and opencode -c may continue a session from a different repository.

Plugins

None

OpenCode version

v1.2.27 (also observed in newer builds before fix)

Steps to reproduce

  1. Create two different repositories with different root commits.
  2. Create bare mirrors under the same parent directory (e.g. /path/org/repo-a.git and /path/org/repo-b.git).
  3. Create worktrees from each bare repo.
  4. Run OpenCode in worktree A, then in worktree B.
  5. Observe project_id cache behavior / session listing (-c) crossing repo boundaries.

Screenshot and/or share link

N/A

Operating System

Linux

Terminal

PTY (CLI)

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 18, 2026
  2. github-actions commented on Mar 18, 2026

    @github-actions
    Contributor

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

  3. rekram1-node commented on Mar 25, 2026

    @rekram1-node
    Contributor

    reassigning since james was working on this last

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions