Skip to content

desktop: project picker can't switch from a nested project to its parent project #58524

Closed as not planned

Description

@JustinCodeMonkey

Summary

In the desktop app, when a project nested inside another project's directory is selected (e.g. ~/Code/Monorepo/apps/Nested), the project dropdown under the new-session prompt box can't switch to the parent project (~/Code/Monorepo). The selection stays on the nested project. Restarting the app shows the parent project correctly.

Environment

  • opencode version: 2.1.4 (desktop app)
  • OS: Darwin 27.0.0 (macOS, arm64)
  • Terminal: Unavailable: desktop app, not run from a terminal
  • Shell: /bin/zsh
  • Install/channel: latest
  • Active plugins: Unavailable: custom plugins are installed, but none looks related to project selection

Reproduction

  1. Have two projects, where one's directory is inside the other's:
    • Monorepo at ~/Code/Monorepo (the monorepo root)
    • Nested at ~/Code/Monorepo/apps/Nested (a folder inside it)
  2. Select Nested as the current project.
  3. On the new session screen, open the project dropdown under the prompt box and choose Monorepo.
  4. The selection stays on Nested.
  5. Restart the app. Monorepo is now shown correctly.

Expected Behavior

Choosing Monorepo in the dropdown switches the new-session view to Monorepo.

Actual Behavior

The dropdown stays on Nested. There is no error. The switch only takes effect after an app restart.

Additional Context

  • Only the nested-to-parent direction fails. Switching from Monorepo to Nested works.
  • Switching between other projects that are not nested in each other works.
  • It is consistently reproducible.
  • This looks like a path-containment check. The selected directory is probably resolved back to the nested project, or the parent is matched to the child because its path is a prefix of the child's path.
  • Workaround: restart the app.

Activity

  1. JustinCodeMonkey commented on Oct 23, 2026

    @JustinCodeMonkey
    Author

    Closing as a probable duplicate or related to #55351, #54034 or #51191. Nested lives inside the Monorepo git repo, so it likely resolves to the same project and hits the same project-chip resolver bug described there.

  2. opencode-agent commented on Oct 23, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report! I couldn't reproduce this here. I tried the web UI of 2.1.4, which shares its frontend code with the desktop app. I added Monorepo and Monorepo/apps/Nested as two projects, selected Nested, started a new session and chose Monorepo in the project dropdown under the prompt. It switched straight away, including when switching back and forth several times. It also worked when the nested folder wasn't its own git repo.

    So it may be specific to the macOS desktop app, which I can't run in this environment. A maintainer with a Mac will need to check it. Some details that would help them:

    • Is Nested its own git repository, or just a folder inside the Monorepo repo?
    • Does it happen in a brand new tab, or only in a tab that was already showing Nested (for example, one restored after starting the app)?
    • Do either of the paths involve a symlink, or differ in letter case from how they were added?

    The closest related issue I found is #51191 (sessions in a nested project folder open at the git repo root), though it's not the same problem.

  3. JustinCodeMonkey commented on Oct 23, 2026

    @JustinCodeMonkey
    Author
    • Nested is not its own Git repository, just a folder inside the monorepo
    • I think it happened in both cases.
    • No symlinks or case differences or how they were added.

    I'm not sure what happened but I can no longer reproduce this issue so I will close it.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions