Skip to content

fix(app): project rename silently fails for non-git projects (id "global") #42853

Closed

Description

@hello2038

Description

Renaming a project via the "Edit Project" dialog silently has no effect when the project's resolved ID is "global" (i.e., a plain/non-git folder, or a git repo with no remote, no commits, and no cached ID). The dialog closes but the displayed name never changes. Restarting, re-opening the project, or closing/re-adding the workspace does not help.

Root cause: for such projects the app's save path (packages/app/src/components/edit-project.ts) only performs the real update when props.project.id is set and not "global":

if (props.project.id && props.project.id !== "global") {
  ... await sdk.client.project.update({ projectID: props.project.id, ... }) // real, persisted save
  return
}
serverCtx().sync.project.meta(props.project.worktree, { name, ... }) // dead store: never read

Project.resolve (packages/core/src/project.ts) returns ID.global for any directory that isn't a git repo, or whose repo has no remote / .git/opencode cache / root commit:

if (!repo) return { id: ID.global, ... }
return { id: id ?? ID.global, ... }

The fallback sync.project.meta(...) writes to childStore.projectMeta (localStorage), but that store is write-only in the codebase — enrich() (global.tsx / layout.tsx) only ever reads the server's data.project. So the rename appears to succeed (dialog closes) but is never persisted or displayed.

Plugins

None (OpenCode Desktop, default plugins).

OpenCode version

1.18.18 (OpenCode Desktop;)

Steps to reproduce

  1. Create a brand-new empty folder (no git), or run git init in a folder but do not commit / add a remote.
  2. In OpenCode Desktop (old layout) click + to add that folder, then open it.
  3. Open the project's Edit Project dialog and change the default name to something new, then click Save.
  4. The dialog closes, but the name in the sidebar stays unchanged.
  5. Repeat after restarting the app, after re-opening the project, and after closing + re-adding the workspace — the rename still has no effect.
  6. (Control) Repeating the same steps on a folder that is a git repo with at least one commit or a remote works fine.

Screenshot and/or share link

Will attach if needed.

Operating System

Windows 11

Terminal

N/A — OpenCode Desktop (Electron app), old layout

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Aug 16, 2026

    @github-actions
    Contributor

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

    If your issue is specifically scoped to the id === "global" code path (non-git/no-remote projects), #40986 is the closest match and already includes the same root-cause analysis.

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

Metadata

Metadata

Assignees

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