Skip to content

Windows linked worktree startup can hang in Project.fromDirectory() while UI shows Loading plugins #25022

Closed as not planned

Description

@ctharvey

On Windows, OpenCode can intermittently hang on startup in linked worktrees while the UI sits on Loading plugins....

This is not just slow startup. In the bad case it never reaches the prompt.

What I traced:

  • startup enters Project.fromDirectory()
  • linked worktree discovery shells out to Git for topology info
  • the calls include git rev-parse --git-common-dir, git config --bool core.bare, and git rev-parse --show-toplevel
  • when that path hangs, the UI still looks like plugin loading is the problem even though the blocker is earlier

Why this looks avoidable:

  • a linked worktree already has the needed metadata on disk
  • the worktree .git file points at the admin dir
  • the admin dir contains gitdir and commondir

So the startup path is depending on Git subprocesses to rediscover data that is already available locally.

I have a patch prepared that resolves linked worktree topology from that metadata first and only falls back to Git if the metadata cannot be parsed safely.

Repro

  • run OpenCode on Windows from a linked worktree
  • in the bad case it stays on Loading plugins... and never reaches the prompt

Scope

This issue is specifically about linked-worktree startup discovery. It is not a claim that every Windows startup delay has the same cause.

Activity

  1. removed
    perfIndicates a performance issue or need for optimization
    on May 3, 2026
  2. github-actions commented on Jul 5, 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