Skip to content

[Bug]: "Delete Workspace" silently does nothing — row disappears and returns in ~200ms, no runtime call, no log entry #16243

Closed

Description

@promix1722

Operating system: Linux
Orca version: 1.4.188

--- Details ---

Short summary:
"Delete Workspace" from the sidebar context menu silently does nothing. The
confirmation dialog appears, I confirm, the row disappears and then reappears in
under 200ms. The workspace is never removed. The runtime receives no call at
all — there is no worktree.remove span, no git worktree remove, and no state
change in orca-data.json. orca worktree rm --force removes the same worktree
reliably.

Setup

  • Orca 1.4.188 AppImage running headless as orca serve on an Ubuntu 24.04 VPS
    (systemd unit, LIBGL_ALWAYS_SOFTWARE=1).
  • Desktop client on Linux, also 1.4.188, paired to that runtime over HTTPS/WSS
    through nginx.
  • A project with one worktree feature-x at ~/orca/workspaces/<project>/feature-x
    (branch feature-x).

Steps to reproduce

  1. On a headless orca serve host, create a workspace (here: feature/x).
  2. In the desktop client, right-click the workspace row → Delete.
  3. The "Delete Workspace" dialog appears:
    "Remove feature/x from git and delete its workspace folder."
  4. Click Delete Workspace.
  5. The row disappears, then reappears within ~200ms. The workspace is untouched.

Repeating the delete gives the same result every time.

Evidence

I snapshotted orca-data.json and both trace logs immediately before the
attempt and immediately after.

Runtime side (~/.config/orca/logs/main.trace.ndjson on the serve host) — the
log grew by exactly 3 lines, all git.exec:

{"kind":"git","git.subcommand":"status","cwd":"<worktree path>"}
{"kind":"git","git.subcommand":"remote","cwd":"<unrelated project>"}
{"kind":"git","git.subcommand":"remote","cwd":"<unrelated project>"}

No worktree.remove span. No git worktree remove or git worktree prune.
The lone git status in the worktree is consistent with the sidebar simply
re-rendering the row it never removed.

For contrast, a successful removal on this same host does emit spans —
worktree.remove, worktree.remove.trash_rename, worktree.remove.branch_delete.
None of those appear here.

Client side (~/.config/orca/logs/main.trace.ndjson on the desktop) — the log
grew by exactly 2 lines, both 60-second-interval renderer_memory crash
breadcrumbs. Nothing related to the delete. No crash dumps in Crashpad/completed.

Persisted state — worktreeMeta is identical before and after. The entry
survives untouched, with the same instanceId:

"<worktree path>": {"instanceId":"<uuid>","displayName":"feature/x", …}

git worktree list and the directory on disk are likewise unchanged.

Runtime's own view of the workspace — nothing is locked, archived, dirty, or
otherwise blocked:

id:          <repo-id>::<worktree path>
instanceId:  <uuid>
hostId:      local
creatorProvenance: {"kind":"paired-device","deviceId":"<device-id>"}
branch:      refs/heads/feature-x
isMainWorktree: false
isArchived:  false

No failure toast appeared. The app has a detailed delete-failure toast with
distinct copy for dirty worktrees, unstopped PTYs, missing registration and
orphaned directories, each offering "Force Delete". None of it fired, which is
consistent with the flow never reaching its error path.

Activity

  1. eakmanrq commented on Aug 24, 2026

    @eakmanrq

    Confirming this on a macOS desktop client → Linux headless runtime pairing (OP was Linux → Linux), and I think the scope is wider than the report suggests.

    Desktop client: 1.4.188 (macOS). Runtime: Linux AppImage on a remote box, paired over the tailnet, refreshed the same day (I couldn't read its version string out of the AppImage directly).

    A create-control makes it unambiguous

    I instrumented a clean window: snapshotted line counts of main.trace.ndjson on both sides, then did create → delete → delete → CLI-delete on one throwaway workspace, all within ~90 seconds.

    Action via New lines in runtime trace git worktree calls Outcome
    Create workspace UI 62 worktree add, 4228 ms created
    Delete Workspace ×2 UI 0 none untouched
    worktree rm --force CLI 36 7 removed

    The creation is the part that settles it: it reached the runtime and did 4.2 s of real git worktree add work, so the client→runtime channel was demonstrably alive at that moment. The delete attempts that followed, seconds later in the same session, produced not one line in the runtime trace. Then orca worktree rm --force on the same workspace removed it cleanly and emitted the expected worktree.remove / worktree.remove.trash_rename / worktree.remove.branch_delete spans.

    So the delete is not failing on the runtime and is not being reverted — it is never dispatched.

    Slightly worse than the original report

    OP saw three git.exec lines per attempt, including a git status in the worktree (consistent with the sidebar re-rendering the row). I get zero runtime lines — no git status, nothing at all. Possibly a second failure mode, or that git status was unrelated polling.

    Client side, the whole episode added 3 lines to the desktop trace: two terminal_webgl_diagnostic breadcrumbs and one 60 s renderer_memory tick. No delete breadcrumb, no IPC span, no error, no crash dump. No failure toast appeared.

    Not scoped to one project or one worktree root

    Reproduced on two different projects on the same runtime:

    • one using the default worktree root (~/orca/workspaces/<project>/)
    • one using an explicit worktreeBasePath on a separate filesystem

    Both fail identically from the UI, both remove fine via CLI. So this isn't specific to a project, a worktree root, or the default-path fallback.

    One correction to the evidence in the report

    orca-data.json staying byte-identical isn't diagnostic on my host — its md5 was unchanged across a successful UI creation too. Workspace metadata lives in orchestration.db there, so that file wouldn't move either way. The trace deltas are the reliable signal.

    Workaround

    orca worktree rm --worktree "id:<repo-id>::<abs-path>" --force is reliable — 3 for 3 here across both projects. Worth flagging for anyone reaching for it: removal runs git branch -D (#2927), so confirm the branch is pushed or already merged before using it.

  2. LesleyMurfin commented on Aug 25, 2026

    @LesleyMurfin
    Contributor

    Confirming on a third topology: Windows desktop client 1.4.188 → Linux headless orca serve 1.4.188 (Ubuntu 6.8), paired over WireGuard (ws://10.200.0.1:6768). Delete Workspace from the UI is a silent no-op — no toast, row returns on refresh — while orca worktree rm --force against the same runtime (_meta.runtimeId: b61dbabd-…) removes the workspace.

    The renderer builds its selector as id:<repoId>::<path> (src/renderer/src/runtime/runtime-worktree-selector.ts). Tested each shape against one throwaway workspace on that runtime:

    # exact id: form — accepted
    orca worktree rm --worktree "id:02b7ab82-…::/…/tmp-16243-probe" --force --json
    {"ok":true,"result":{"removed":true}}
    
    # same path, trailing slash
    orca worktree show --worktree "id:02b7ab82-…::/…/tmp-16243-probe-2/" --json
    {"ok":false,"error":{"code":"selector_not_found","message":"selector_not_found"}}
    
    # same trailing slash, path: form — resolves
    orca worktree show --worktree "path:/…/tmp-16243-probe-2/" --json
    {"ok":true,"result":{"worktree":{"id":"02b7ab82-…::/…/tmp-16243-probe-2", …}}}
    
    # id: with a repoId belonging to another repo
    {"ok":false,"error":{"code":"selector_not_found","message":"selector_not_found"}}
    

    So the id: shape itself is not rejected; it is matched as an exact string with no path normalization, whereas path: normalizes. Any divergence in the path or repoId the renderer holds yields selector_not_found. show and rm miss identically, so this is not rm-specific.

    Observation on #16295: it makes this surface as a visible selector_not_found instead of remove-worktree.ts treating it as a stale local mirror and returning ok:true — the selector miss itself is still there.

  3. LesleyMurfin commented on Aug 25, 2026

    @LesleyMurfin
    Contributor

    Bisected the regression, since nobody has named it yet.

    id: selector resolution became exact-string-only in b82a879 — perf(runtime): resolve an explicit worktree id without scanning every repo (#14399, 2026-08-14, first release tag containing it: v1.4.186). Before it, an id: selector was matched across the fleet from rows rebuilt as ${repo.id}::${gitWorktree.path}; after it, id: is the one selector kind resolved inside a single repo by ===, with no normalization and no fallback. Its own comment states the asymmetry: "Why only id:: every other selector kind is matched across the whole fleet." path: kept comparing through normalizeRuntimePathForComparison.

    #15013 (STA-4343, 2026-08-17) then routed workspace removal through that scoped resolver (resolveWorktreeRemovalTarget → resolveScopedWorktreeIdRow), so a scoped miss became a hard selector_not_found. Since the renderer can only address a workspace by id (toRuntimeWorktreeSelector always emits id:<repoId>::<path>), the UI inherited the strict comparison while the CLI's path: form kept the lenient one — which is why orca worktree rm --worktree path:… --force still works on a workspace the UI cannot delete.

    That matches the timeline in this thread: all three reports are 1.4.188, and the CLI never regressed.

    Relevant prior art for whoever picks this up: #15616 (open) already adds worktreeIdComparisonKey in src/shared/worktree/id.ts, folding separator and drive-letter spelling through normalizeRuntimePathForComparison, and applies it to two other exact-string id checks. A fix here looks like the same comparison key applied to the two remaining sites (resolveWorktreeSelector's id: branch and resolveScopedWorktreeIdRow), keeping the repo-id half exact and the exact-match fast path first. #11073 (open) is worth respecting alongside it: an unstoppable PTY must still fail a destructive delete closed even when the selector cannot resolve.

  4. LesleyMurfin commented on Aug 25, 2026

    @LesleyMurfin
    Contributor

    #16494 is open and addresses one of the two mechanisms in this thread. Deliberately no closing keyword: the other mechanism is untouched and, so far, unreproduced.

    What it fixes

    The id: branch of resolveWorktreeSelector — and resolveScopedWorktreeIdRow behind removal — compared the selector against the stored row by exact string equality, while the path: branch a few lines below has always compared through normalizeRuntimePathForComparison. Since the renderer can only address a workspace by id (toRuntimeWorktreeSelector always emits id:<repoId>::<path>), any path-spelling divergence between the stored id and what git worktree list reports — trailing slash, doubled separator, Windows backslash or drive-letter case, NFC/NFD accent — came back selector_not_found.

    The silence is the other half of it: the renderer's removal path reads selector_not_found as a stale local mirror, calls forgetLocal, and returns ok: true. Nothing is raised, no toast, and the row reappears on the next refresh. The patch runs both id comparison sites through one comparison key, keeping the repo-id half exact and the exact-match fast path first.

    What the bisect shows

    b82a8791f5 (#14399, first shipped in v1.4.186) made id: the only selector kind resolved without a fleet fallback; 64de8dd637 (#15013, STA-4343) then routed removal through that scoped resolver, turning a scoped miss into a hard selector_not_found. That is what the bisect points at — I make no claim about intent.

    Before / after

    Live A/B on one host, same CLI, real git worktrees, only the runtime binary differing (released 1.4.188 vs a runtime built from the branch):

    Command 1.4.188 patched runtime
    rm id:<repoId>::<path>/ (trailing slash) selector_not_found removed: true
    follow-up show of that exact id, after the failed rm ok: true — the worktree survived its own deletion refuses
    rm path:<path>/ removed removed
    rm id:<other-repo-id>::<path> refused refused

    What it does not fix

    It does not explain the OP's trace or @eakmanrq's instrumented session. The OP saw three extra git.exec lines and no worktree.remove span; @eakmanrq saw a UI create reach the runtime and spend 4.2 s in real git worktree add work, while two UI deletes seconds later produced not one runtime trace line, and the CLI then removed the same workspace normally. A selector miss cannot produce that shape, because resolution happens inside the runtime — the call has to arrive first. For those reports the delete appears never to have been dispatched at all, which is a different fix in a different process (the renderer's dispatch path), and I have no reproduction for it. This issue should stay open until that half is accounted for.

    Caveat on causality

    Nobody captured the selector string the original reporters' clients actually sent, so the causal link between this fix and their failures is unproven. The third report above (Windows client against a Linux headless runtime) is the one that captured the asymmetry directly. The OP's and @eakmanrq's traces are the reason we know there are two mechanisms here and not one.

    Related

    #16295 is complementary rather than overlapping: it makes the miss fail loudly instead of silently, which is orthogonal to making it not miss.

    Workaround today

    path: selectors were never affected:

    orca worktree rm --worktree "path:/absolute/path/to/workspace" --force
    
  5. LuisUrrutia commented on Aug 26, 2026

    @LuisUrrutia
    Contributor

    I reproduced the previously unaccounted case on v1.4.188 and observed exactly one worktree.rm dispatch. It failed on the runtime:<environmentId> vs. local host-ID mismatch before the worktree.remove span was created, so the missing span did not mean the RPC was never sent.

    Applying only #16039 made the same E2E pass. This mechanism therefore appears fixed by #16039; #16494 covers the separate path-mismatch case.

  6. nwparker commented on Aug 26, 2026

    @nwparker
    Contributor

    will confirm

  7. AmethystLiang commented on Aug 26, 2026

    @AmethystLiang
    Contributor

    Update: #16039 should fix the paired-runtime deletion failure reported here. It resolves the client/runtime host-ID mismatch that left deleted worktrees reappearing, and has merged to main.

    It was not included in v1.4.190. The usual release window for a landed PR is 48–72 hours (outside P0+ fixes), so it is expected in the next daily release cycle.

  8. OrcaWin commented on Aug 27, 2026

    @OrcaWin
    Collaborator

    Status update — both mechanisms named in this thread are now fixed on main. Keeping this open for confirmation on the reported topologies; see the caveat at the end.

    Mechanism A — host-ID mismatch: fixed in #16039 (merged 1a7934c54f)

    A paired client spelling its host runtime:<environmentId> against a runtime that spells it local failed inside worktree.rm before the worktree.remove span was created. That is why @promix1722's and @eakmanrq's traces showed no span and read as "never dispatched" — as @LuisUrrutia reproduced, exactly one worktree.rm did arrive. resolvePairedCallerHostId now translates the spelling before the host-qualified read.

    Mechanism B — id: selector compared byte-exact: fixed in #16494 (merged de6fe8b7ea)

    @LesleyMurfin's bisect was accurate. I reproduced it on main before merging: resolveScopedWorktreeIdRow (repo-worktree-row-resolution.ts:198) and the id: branch of resolveWorktreeSelector (orca-runtime.ts:32023) both matched the stored id with ===, while the path: branch fourteen lines below (:32037) has always compared through normalizeRuntimePathForComparison. A trailing slash, a doubled separator, or a Windows drive-letter difference each returned selector_not_found; the exact spelling resolved. Both id sites now run through one comparison key that keeps the repo-id half exact, folds only the path, and tries the exact match first.

    Ambiguity still fails closed: where two rows spell one directory, the scoped lookup refuses and the fleet selector raises selector_ambiguous rather than picking a winner. That matters because this resolver gates a destructive delete.

    Verification before merge: reproduction flipped to passing, 47/48 CI checks green (1 e2e job skipped, no e2e specs touched), full three-project typecheck clean, and the 505-file runtime/worktree/removal suite showed a failure set byte-identical to main on the same base — no new failures. No lockfile, package.json, workflow, or native binary touched.

    The silence is a third thing, and it is still there

    Neither fix changes the fact that the renderer reads selector_not_found as a stale local mirror, calls forgetLocal, and returns ok: true — no toast, row back on the next refresh. Both fixes remove causes of the miss; none makes a miss loud.

    #16295 aimed at exactly this and I've closed it — detailed reasoning there. Short version: it keyed on currentResolution.kind === 'resolved', which at that point in removeWorktree is true for essentially every delete (the row hasn't been torn down yet, and the host-qualified branch returns resolved for any parseable host). So it removed the forgetLocal self-heal wholesale and made a genuinely stale row — including one removed via the orca worktree rm --force workaround this issue recommends — permanently undeletable from the UI. It broke two shipped tests to that effect. The intent is right and worth redoing against a real liveness signal.

    Why this stays open

    Nobody captured the selector string the original clients actually sent, so the causal link between Mechanism B and @promix1722's and @eakmanrq's specific failures is inferred, not proven. @LesleyMurfin's Windows-client report is the one that demonstrated the asymmetry directly. If those of you who hit this can retest once these land in a build, that would close it properly.

    Thanks to everyone who instrumented this — the create-control, the three-topology confirmations, the bisect, and the E2E repro are the reason two distinct mechanisms got separated instead of one guess getting shipped.

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