Skip to content

Project icons are incorrectly inherited by new projects #9087

Closed as not planned

Description

@stenci

Description

Project icon assignment is incorrectly inherited from an existing project instead of being independent.

I have 4 existing projects with icons assigned and several projects without icons. When I create a new project, it automatically gets the icon of the first project that has an icon assigned.

Additionally, editing or removing the icon of that first project or any new project causes all newly created projects (that inherited the icon) to update or revert together. This does not affect all projects, only:

  • the first project with an icon
  • all projects created after that point

This suggests icon inheritance or default state is incorrectly tied to the first iconized project.

Plugins

No response

OpenCode version

  • The icons were correctly created with versions < 1.1.23
  • The issue first appeared on 1.1.23
  • The issue still reproduces on 1.1.25

Steps to reproduce

  1. Have multiple existing projects, with at least one project having an icon.
  2. Create a new project.
  3. Observe that the new project inherits the icon of the first project with an icon.
  4. Edit or remove the icon of that first project.
  5. Observe that all newly created projects update or revert their icon together.

Screenshot and/or share link

Image Image

Operating System

Windows 10

Terminal

No terminal, I'm using the desktop application

Activity

  1. stenci commented on Jan 17, 2026

    @stenci
    Author

    I reverted back to version 1.1.21 and the problem persists.

    Using 1.1.21, I was originally able to create 4 projects and assign 4 different icons successfully. I then upgraded to 1.1.23 and 1.1.25 and created additional projects; all newly created projects shared the same icon.

    After reverting again to 1.1.21, those newly created projects still share the same icon, even if I edit or remove their icons.

    This suggests the issue is introduced during project creation in versions >= 1.1.23, rather than being a general icon management problem.

  2. stenci commented on Jan 19, 2026

    @stenci
    Author

    I dug into the code and found the root cause. Project IDs are derived from the git root commit. If the working directory has no .git or the repo has no commits, opencode falls back to projectID = "global". That means all those projects share the same storage/project/global.json, so icons appear inherited and edits apply together.

    My workflow often includes a single parent folder with no git repo, containing multiple subfolders, each with its own git repo (web app, Excel macro, tools, etc.). I keep them together so one opencode session can coordinate changes across all of them. Because the parent has no .git, new projects end up in "global".

    Suggested fix for non‑git folders: persist a stable per‑directory project ID instead of using "global". Two possible approaches:

    • Use the directory name (better than global, but renames break identity).
    • Create a .opencode folder inside the directory that stores a generated project ID (and possibly the icon).

    I strongly prefer option 2 because it keeps identity stable across renames and gives a natural place to store project‑level assets like icons.

  3. attkri commented on Feb 15, 2026

    @attkri

    I can reproduce this on Desktop and can confirm the behavior is identity-coupling related, not just UI rendering.

    Observed:

    • New projects can inherit an existing icon.
    • Updating/removing the original icon updates inherited ones as well.

    Likely cause:

    • Projects without a resolvable git-based identity appear to fall back to a shared/global ID, so multiple projects map to the same project storage entry.

    Suggested fix direction:

    1. Never use a shared fallback identity across distinct project paths.
    2. Generate a per-project stable fallback ID (path-derived hash or local project metadata).
    3. Add migration logic for existing "global"-backed entries to avoid breaking existing users.
    4. Add regression tests:
      • non-git folder A and non-git folder B must produce different project IDs
      • icon updates in A must not affect B
      • behavior remains stable across app restart

    Happy to help test a patch build on Windows.

  4. attkri commented on Feb 15, 2026

    @attkri

    Additional reproducible scenario from Windows Desktop (likely related persistence regression):

    1. Right-click project icon -> Edit
    2. Select an SVG icon file located in the repo root
    3. Save -> icon is shown correctly
    4. Close OpenCode Desktop and open it again
    5. Icon is gone and falls back to the default first-letter avatar

    Expected:

    • The selected icon should persist after app restart.

    Regression note:

    • This worked before version 1.20 (per repeated local testing).
  5. attkri commented on Mar 6, 2026

    @attkri

    Additional evidence from Windows Desktop vs Web UI:

    I verified this is not only a backend/storage problem.

    Observed:

    • Same OpenCode server: http://192.168.0.101:4096
    • Same project/worktree: C:/Users/attila/Projects/OpCo-Know
    • Same project ID from the server API:
  6. removed
    bugSomething isn't working
    webRelates to opencode on web / desktop
    on May 3, 2026
  7. github-actions commented on Jul 6, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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