mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
The web client persists its workspace session (activeWorktreeId, lastVisitedAtByWorktreeId, ...) in localStorage and, unlike the main-process Store, gets no load-time orphan GC. `pruneLastVisitedTimestamps` already drops stale focus-recency entries on hydration, but the persisted `activeWorktreeId` pointer is not reconciled — so a pointer to a worktree the server no longer reports lingers (the main-process path clears it via removeWorkspaceSessionOwner when a repo is removed; the web has no equivalent), and can surface a phantom / duplicate workspace that survives reloads. Extend the hydration reconcile to also clear `activeWorktreeId` once its repo is hydrated and the worktree is confirmed gone, mirroring the existing per-repo defer rule (a not-yet-hydrated repo, e.g. SSH pre-connect, keeps its pointer). Co-authored-by: fanyunqian.1 <fanyunqian.1@bytedance.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>