VS Code extension crashes with AppRoutes error boundary ("Something went wrong") when a workspace repo has a prunable git worktree

Resolved 💬 0 comments Opened Jul 24, 2026 by Tae-sam Closed Jul 24, 2026

What version of the IDE extension are you using?

26.721.30844

What subscription do you have?

Free

Which IDE are you using?

VS Code 1.130.0

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

When a folder added to the Codex workspace is a git repository that contains a prunable git worktree — one whose gitdir points to a non-existent location (the working directory was deleted but git worktree prune was never run) — the Codex panel webview crashes on load with a React error boundary at AppRoutes. The panel shows "Something went wrong" with a Retry button; Retry re-crashes, so the panel stays unusable for that window.

Removing the repo from the workspace, or running git worktree prune in that repo, fixes it immediately.

Relevant log line (Codex.log):

[error] error boundary componentStack="… at AppRoutes …" error={} name=AppRoutes

git confirms the broken worktree:

$ git worktree list
.../.worktrees/api-list-p0 <sha> [codex/api-list-p0] prunable
$ git worktree prune -n -v
Removing worktrees/api-list-p0: gitdir file points to non-existent location

Note: these worktrees are created by Codex's own worktree feature (branches prefixed codex/), so this is reachable through normal Codex usage when a worktree directory is later removed without pruning. A sibling repo in the same workspace with a valid worktree of the same name renders fine — only the prunable one triggers the crash.

What steps can reproduce the bug?

  1. In any git repo, create a Codex-style worktree, then delete its directory so git marks it prunable:

git worktree add .worktrees/test -b codex/test
rm -rf .worktrees/test # Windows: rmdir /s /q .worktrees\test
git worktree list # -> ".../.worktrees/test <sha> [codex/test] prunable"

  1. Add that repository as a folder to a VS Code workspace that has the Codex extension.
  2. Open the Codex panel.

The panel crashes with the AppRoutes error boundary ("Something went wrong") and Retry re-crashes.

What is the expected behavior?

Codex should tolerate/skip prunable or invalid worktrees (e.g. filter out worktree entries whose gitdir points to a non-existent location, or surface a non-fatal warning) instead of letting the whole AppRoutes React tree throw and taking down the panel.

Additional information

  • Workaround: run git worktree prune in the affected repository.
  • Possibly related: discussion #16440 (agent-created worktree ↔ UI/thread sync) and #20188 (workspace_dependencies load failure).

View original on GitHub ↗