Repository navigation
Description
Operating system: macOS 26.2 (Apple Silicon)
Orca version: 1.4.68
Short summary
A single stale/unresolvable git worktree pointer sends Orca's repo/worktree reconcile path into an unbounded loop: repos:changed broadcasts at ~25/sec and git worktree subprocesses spawn at ~10/sec, indefinitely. Each repos:changed drives a renderer fetchRepos() and re-derives downstream state, so the whole app churns (constant re-renders + CPU/battery burn). Orca should detect that a worktree's gitdir is missing and fail that worktree gracefully instead of spinning.
How it happens
A worktree's .git file contains gitdir: <path>. If the main repo directory is renamed/moved (very common), that path goes stale and no longer exists. In my case the repo dir was renamed drafthouse → drafthouse-internal, leaving a worktree pointer at:
gitdir: /Users/mack/apps/drafthouse/.git/worktrees/cursive-blob # missing
git worktree list from the main repo still looks fine, but operations from that worktree (e.g. git:upstreamStatus) fail with fatal: not a git repository, and the reconcile loop never converges.
Evidence (measured live via DevTools console)
window.api.repos.onChangedfired 256 times in 10 s (~25/sec);worktrees:changedfired 0 — so it's repo-level reconcile, not file-change driven.- Trace log (
main.trace.ndjson): 866git.execspans in 82.9 s (~10.4/sec), of which 819 weregit worktree, split across the two local repos. - Visible symptom: the sidebar "Live Ports" plug icon (
WorktreeCardPortsTrigger) flickers near-constantly. It's driven byWorkspacePortScanner, whose effect callssetWorkspacePortScan(null)on every re-run; the constantrepos:changed→ newreposidentity →scanTargets/refreshidentity change re-runs that effect, wiping the shared scan state. DOM probe: plug present only ~21–34% of samples, all plugs blinking in lockstep (shared-state wipe, not per-port).
Reproduction
git worktree add ../wt-demoin some repo; add the repo to Orca so the worktree shows in the sidebar.- Break the pointer the way a rename would: rename the main repo dir (
mv repo repo2) so the worktree'sgitdir:target no longer exists. (Re-add/keep it visible in Orca.) - Observe:
git worktreesubprocesses andrepos:changedevents fire continuously; CPU stays elevated; any worktree with a detected listening port shows a flickering ports plug.
Workaround (also the confirming fix)
cd <main-worktree> && git worktree repair — re-points the stale gitdir. The storm stopped immediately and CPU dropped.
Suggested fix
When a worktree's gitdir is unresolvable, mark that worktree unavailable and skip/back off rather than re-broadcasting repos:changed and re-running git worktree on a tight loop. (Bonus: WorkspacePortScanner shouldn't clear the shared scan to null on every effect re-run — keep last-good results so a transient re-run doesn't blank the UI.)
I traced the symptoms, trigger, and repro but did not pin the exact reconcile loop in orca-runtime; happy to dig further if useful.
Activity
davideiffert commentedon Jun 15, 2026
Closing this — my original diagnosis was wrong.
On further investigation, the stale worktree gitdir pointer is not the cause. After repairing the pointer (
git worktree repair), the samerepos:changed+git worktreestorm recurred — in fact it intensified on v1.4.70 (~40git worktree list/sec across repos), with the pointer healthy and no file changes triggering it. So this looks like a runaway poll/feedback loop independent of any pointer state, not the stale-pointer scenario I described.The underlying problem (an unbounded worktree-reconcile loop driving constant
repos:changed) does appear real and worth fixing, but I'd rather pin the exact trigger before reporting than leave an inaccurate issue open. I'll open a fresh, properly-scoped issue once I have it nailed down. Apologies for the noise.