Repository navigation
fix(worktrees): stop a failed worktree scan from being recorded as an authoritative empty listing - #18456
Conversation
…itative empty listing A `git worktree list` that could not run at all — a WSL distro that stopped resolving, a hung mount, a git binary that errored — was softened to `[]` by the lenient listing path, so the detected scan published it as `authoritative: true, worktrees: []`. That disables the #1158 retention guard, drops every persisted tab for the repo, and the pruned session is written back to disk on the next launch. The loss is permanent, not a transient glitch. Route the detected scan through a strict listing that still reports the two genuinely empty states (repo path gone, not a Git repo) as `[]`. Everything else rejects, so the existing catch answers `authoritative: false` and the destructive halves (`rememberLocalWorktreeRoots`, `pruneLineageForMissingRepoWorktrees`) never see a failed scan. Also make the failure readable: wsl.exe reports its own launch failures as exit 0xFFFFFFFF with an EMPTY stderr and the `Wsl/Service/WSL_E_*` line on stdout as UTF-16LE, which is why the field bundle carried a git error with no text. Set WSL_UTF8 for WSL-routed git (matching the wsl runner, #9010) and attach that stdout diagnostic to the error so `git.exec` spans name the cause.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (23)
📝 WalkthroughWalkthroughThe change adds WSL host-failure decoding and error annotation for failed Windows Git commands. Windows Git environments now request UTF-8 WSL output. Worktree scanning now distinguishes missing or non-repository paths from Git and WSL failures. Detected scans use the stricter behavior and report failed scans as non-authoritative. Tests cover diagnostics, encoding, scan caching, authority, authorization roots, lineage cleanup, and unavailable-reason state. Merge Risk: ⚪ Minimal · up to Failed Git or WSL worktree scans no longer authorize an empty result that could remove saved worktree metadata or tabs, while genuine missing and non-repository paths remain empty. No current merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description provides extensive technical context, rationale, trade-offs, and test evidence. However, it omits required template sections, leaves the mandatory linked issue as Resolution Add a valid linked issue number, add the missing required headings and content for Why, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. For the sidebar indicator change, attach before/after visual proof; if visual proof is not possible, explicitly explain why under Visual Proof.
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- P0 de-laundering —
listWorktreesStrictAllowingTrueEmpty(plus a new'strict-true-empty'scan kind) rejects any Git/host failure except the two true empties, so a dead WSL distro can no longer be published as an authoritative empty listing. - Host-routing refactor —
listRepoWorktreesForDetectedScanshareslistRepoWorktrees' folder/SSH/runtime routing vialistRoutedRepoWorktrees, changing only the local lister; both detected-scan call sites switch to it. - P1 diagnosability —
WSL_UTF8=1on win32 plusreadWslHostFailureDiagnostic/annotateWslHostFailureclassify exit0xFFFFFFFF+ empty stderr and prefix thegit.execspan with theWSL_E_*text. - Tests — the authority integration test (
detected-scan-failure-authority.test.ts) exercises the real capability-cache rethrow path with exactauthoritativeassertions, and the classifier/wiring tests are non-theatre (both go RED with the production hunk reverted).
I independently traced the rejection through CapabilityProbeCache.runWithFallback (rethrows non-unsupported errors), confirmed authoritative: false reaches the #1158 renderer guard, and verified the extraction is byte-equivalent to the two lenient catches. The disclosed trade-offs (WSL deleted-dir retention, lost negative caching, coalescing loss) are real but conservative, and the follow-up list covers them.
ℹ️ Adjacent to trade-off 4: the buffer and sync exec paths also miss WSL_UTF8
gitExecFileAsyncBuffer (git-exec-file.ts:228) and gitExecFileSync both build env via untranslatedGitOutputEnv, not nonInteractiveGitEnv, and neither runs through the capture() wrapper that applies annotateWslHostFailure. A dead distro on a git show blob read or a sync git command therefore still reaches telemetry as UTF-16 mojibake with no cause. Out of scope for the worktree-scan data-loss this PR fixes, and the same class as the already-disclosed streaming/network gaps, but worth folding into follow-up 2 so the diagnosability story is complete.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…ader with a retry A failed scan now travels with its reason (optional unavailableReason on DetectedWorktreeListResult), the repo header shows it with click-to-retry, and the WSL deleted-guest-directory shape measured on a real Windows host is pinned as retained-not-pruned.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The second commit builds the P2 user-facing layer on top of the already-reviewed P0/P1 de-laundering fix, all scoped to surfacing a retained-but-unscannable repo's cause:
unavailableReasonon the detected listing —DetectedWorktreeListResultgains an optionalunavailableReason?: string(src/shared/worktree/types.ts), additive and wire-safe;detected-provider-listing.tssets it fromdescribeWorktreeScanFailure(err)on both the local-failure and provider-threw-while-connected SSH branches, while the disconnected-SSH and conflicting-owner paths correctly stay reason-less (no glyph).describeWorktreeScanFailure— extracts the first two non-empty lines of the error message (the classifier's summary plus itsWSL_E_*code, dropping the raw command that follows), capped at 240 chars with a no-diagnostic fallback.RepoScanUnavailableIndicator— a destructive-tinted header glyph rendered only for!authoritative && unavailableReason, whose tooltip states the reason and that worktrees are kept, and whose click re-runsfetchWorktreesfor the repo's execution host; wired intoSectionHeader.tsxbehindisRepoHeader.- Equality + i18n —
unavailableReasonfolded into bothmergeDetectedWorktreesForHostandareDetectedWorktreeResultsEqualso a changed cause re-renders, plus threeauto.components.sidebar.RepoScanUnavailableIndicatorleaves inen.json.
The two new test files (RepoScanUnavailableIndicator.test.tsx, detected-worktree-unavailable-reason.test.ts) plus the extended authority test are non-theatre — I ran all four new/changed files (16 tests) green locally, and the assertions pin exact reasons and authority flags rather than loose truthiness.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
# Conflicts: # src/main/ipc/worktrees/listing/detected-provider-listing.ts
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
… authoritative empty listing (stablyai#18456) * fix(worktrees): stop a failed worktree scan from pruning as an authoritative empty listing A `git worktree list` that could not run at all — a WSL distro that stopped resolving, a hung mount, a git binary that errored — was softened to `[]` by the lenient listing path, so the detected scan published it as `authoritative: true, worktrees: []`. That disables the stablyai#1158 retention guard, drops every persisted tab for the repo, and the pruned session is written back to disk on the next launch. The loss is permanent, not a transient glitch. Route the detected scan through a strict listing that still reports the two genuinely empty states (repo path gone, not a Git repo) as `[]`. Everything else rejects, so the existing catch answers `authoritative: false` and the destructive halves (`rememberLocalWorktreeRoots`, `pruneLineageForMissingRepoWorktrees`) never see a failed scan. Also make the failure readable: wsl.exe reports its own launch failures as exit 0xFFFFFFFF with an EMPTY stderr and the `Wsl/Service/WSL_E_*` line on stdout as UTF-16LE, which is why the field bundle carried a git error with no text. Set WSL_UTF8 for WSL-routed git (matching the wsl runner, stablyai#9010) and attach that stdout diagnostic to the error so `git.exec` spans name the cause. * fix(worktrees): surface a failed worktree scan's cause on the repo header with a retry A failed scan now travels with its reason (optional unavailableReason on DetectedWorktreeListResult), the repo header shows it with click-to-retry, and the WSL deleted-guest-directory shape measured on a real Windows host is pinned as retained-not-pruned.

What
On a Windows host whose WSL distro has gone away (renamed, unregistered, or wedged after a Windows/WSL update), every
git worktree listOrca routes throughwsl.exefails with exit4294967295and an empty stderr.listWorktrees(pre-changesrc/main/git/worktree-listing.ts:81-82) caught any failure, logged a warning, and returned[].That
[]was indistinguishable from "this repo genuinely has no worktrees". The detected-worktree scan consumed it throughlistRepoWorktrees(pre-changesrc/main/ipc/worktrees/listing/detected-worktree-scan-cache.ts:114,147),detected-provider-listing.tstook the success path and returnedauthoritative: true, worktrees: [], and the two destructive side effects downstream of that —rememberLocalWorktreeRootsandpruneLineageForMissingRepoWorktrees— ran against an empty truth. The renderer's #1158 retention guard (src/renderer/src/store/slices/degraded-repo-worktree-validity.ts:52-77) only protects rows for repos that are not authoritative, so an authoritative empty listing walked straight past it and the persisted worktrees plus their attached agent tabs were dropped.Root cause to file:line:
src/main/git/worktree-listing.ts:81-82(pre-change) laundering an arbitrary Git/host failure into[], consumed as authoritative atsrc/main/ipc/worktrees/listing/detected-worktree-scan-cache.ts:114,147(pre-change).Field impact: 1 field report with a user note (murlock1000, Windows, v1.4.195: "The agent tabs are not restoring after update"). The low report count understates it: this is permanent data loss, not a transient glitch. Once the prune runs, the worktree metadata and lineage are gone from the store; repairing the WSL distro afterwards does not bring the tabs back.
The fix, in two parts:
P0 — stop the laundering.
src/main/git/worktree-listing.tsextracts the existing softening predicate asisTrueEmptyWorktreeListing(repoPath, err)— repo path ENOENT and really gone, orisNotGitRepositoryError— leaving the two lenient catches byte-equivalent, and addslistWorktreesStrictAllowingTrueEmpty, which islistWorktreesStrictplus exactly those two empties.src/main/git/worktree-scan-cache.tsaddslistWorktreesSharedStrictAllowingTrueEmptyunder a new scan kind'strict-true-empty'(a strict joiner must not inherit[]; a lenient joiner must not inherit a rejection).src/main/repo-worktrees.tsaddslistRepoWorktreesForDetectedScan, which shareslistRepoWorktrees' host routing (folder / runtime / SSH paths untouched) but uses the strict local lister. Both detected-scan call sites now use it. The failure propagates out oflistDetectedGitWorktrees, sodetected-provider-listing.ts:146-170returnsauthoritative: false, worktrees: [], the two destructive side effects are never reached, and the #1158 guard keeps the worktrees and their tabs.P1 — make the failure diagnosable.
src/main/git/command-runner/git-process-env.tssetsWSL_UTF8: '1'on win32 (same reason assrc/main/wsl/wsl-runner.ts:129, #9010) sowsl.exestops emitting its own diagnostics as UTF-16LE. Newsrc/main/git/command-runner/wsl-host-failure.ts(readWslHostFailureDiagnostic/annotateWslHostFailure) classifies exit0xFFFFFFFF+ empty stderr on a WSL-routed command as a host failure, strips UTF-16 NULs, and prefixes the error message with theWsl/Service/WSL_E_*text while preservingcode,stdout,stderrand the original message. Wired intogit-exec-file.tsaround both capture paths, sogit.execspans record it.P2 — tell the user, and give them a way out. A retained-but-unscannable repo used to be indistinguishable from a healthy one in the sidebar.
DetectedWorktreeListResultgains an optionalunavailableReason?: string(src/shared/worktree/types.ts), set only on the failed-scan catch indetected-provider-listing.tsfromdescribeWorktreeScanFailure(worktree-listing-diagnostics.ts: first two non-empty lines of the error, so thewsl.exe host failure (distro "…"): … Wsl/Service/WSL_E_*text P1 produces is what arrives). The repo header rendersRepoScanUnavailableIndicator(src/renderer/src/components/sidebar/worktree-list/rows/) when a listing is non-authoritative and carries a reason: a destructive-tinted warning glyph whose tooltip states the reason and that existing worktrees are kept, and whose click re-runsfetchWorktreesfor the repo's execution host. The two renderer equality checks (detected-worktree-host-merge.ts,worktree-catalog-visibility.ts) include the reason so a changed cause re-renders. A non-authoritative listing without a reason (disconnected SSH host, conflicting owner) renders nothing, as before.No argv changed, so
buildWslExecArgs/buildWslCapturedLoginShellCommandare untouched. Wire:unavailableReasonis a new optional field on an existing response type (additive, safe perdocs/reference/remote-wire-compatibility.md);authoritativealready existed.Fix evidence
P0 — RED with the production hunk reverted (detected scan put back on the lenient
listRepoWorktrees; test file unchanged):P0 — GREEN with the hunk restored:
The four cases: WSL host failure →
authoritative:false+ no roots registered + no lineage prune;fatal: not a git repository→authoritative:true, worktrees:[]+ side effects run; repo path ENOENT →authoritative:true, worktrees:[]; healthy scan →authoritative:truewith the worktree listed. OnlygitExecFileAsyncis mocked, so the realworktree-listing→worktree-scan-cache→repo-worktrees→detected-worktree-scan-cache→detected-provider-listingchain executes.P1 — RED with the annotation call and the
WSL_UTF8assignment reverted (the classifier module was left in place, so its 3 pure unit tests still pass; the 2 wiring tests fail):P1 — GREEN with the hunks restored:
Live reproduction on a real Windows host (
awin, driven throughorca terminalon--environment awin, Git Bash) against a livewsl.exewith a distro name that does not exist — this is the exact input shape the classifier keys on:P2 — RED with the
unavailableReasonassignment indetected-provider-listing.tsand the equality hunk inworktree-catalog-visibility.tsreverted (indicator component left in place):P2 — GREEN with the hunks restored:
(
RepoScanUnavailableIndicator.test.tsx: renders nothing for authoritative or reason-less listings; renders the destructive marker for a failed scan and callsfetchWorktrees(repoId, { executionHostId })on click.)Live
wsl.exeshapes on the real Windows host (awin, Git Bash viaorca terminal, NodespawnSyncwithWSL_UTF8=1, argv identical toresolveCommand's non-login-shell form) — this is the measurement behind Trade-offs 1 and 2:Row 2 is the deleted-guest-directory shape from Trade-off 1 (exit 1,
bash: cd, no ENOENT), now pinned by theretains a WSL repo whose guest directory is gonecase. Row 1 is the dead-distro shape and its cost: ~30 ms per spawn. Probe files were removed and the probe terminal closed.Full verification, all run from the branch working tree:
A broad sweep of
src/main/ipc src/main/git src/main/runtime src/main/repo-worktrees.test.tspassed 12325 tests / 4 skipped, with one unrelated load flake (src/main/ipc/ephemeral-vm.test.ts,EPIPEwriting to a child stdin) that passes in isolation.What is NOT proven — stated explicitly:
awinprobe ran a JavaScript transliteration ofwsl-host-failure.ts, not the shipped TypeScript. The Windows host has no build of this branch. What the probe proves is that exit4294967295+ 0-byte stderr + diagnostic-on-stdout (UTF-16LE withoutWSL_UTF8, UTF-8 with it) is the genuinewsl.exehost-failure shape and that the classification logic extracts theWSL_E_code from both encodings. The shipped TypeScript is covered by the unit tests plus thegitExecFileAsyncwiring tests above, not by the probe.degraded-repo-worktree-validity.ts:52-77→workspace-terminal-row-plan.tsis unchanged by this PR; this fix only changes theauthoritativeflag that guard reads. That the flag reaches and satisfies the guard was verified by source reading, not by running the renderer. The P2 indicator is unit-tested (mount, click →fetchWorktrees) but was not screenshotted in the built app.Host hygiene: the probe file
C:\tmp\orca-wsl-probe.cjswas deleted (lsconfirms it is gone) and the probe terminal tab was closed.ELI5
Orca keeps a list of your working folders (worktrees) and pins your agent chat tabs to them. To refresh that list on Windows, it asks the Linux-inside-Windows environment (WSL) "what folders do you have?"
After a Windows update, that Linux environment can vanish or break. When it does, the question fails — and, importantly, it fails silently: the error message comes back completely blank. Orca's old code saw a failed question with no explanation and treated it as if Linux had cheerfully answered "I have zero folders."
Orca believed it. It deleted its record of every worktree for that repo, and the agent tabs attached to them disappeared. That is what the one user who reported this saw: "the agent tabs are not restoring after update." And because Orca had already erased the records, fixing WSL afterwards did not bring the tabs back — they were gone for good.
This change teaches Orca the difference between two answers that used to look identical: "I checked, and there really are zero folders" (safe to clean up) and "I couldn't check" (do nothing, keep everything). Only the first kind now allows anything to be deleted. The second kind is marked as an unreliable answer, and an existing safety net already knows to leave your data alone when the answer is unreliable.
The second half of the change makes the blank error stop being blank. Windows was writing the explanation in a text encoding Orca did not read, so it looked empty; Orca now asks for it in a readable encoding and attaches the real reason ("there is no distribution with that name") to the error. So next time this happens, the logs say why instead of showing an error with no text.
And the third part puts that reason where you can see it: the project's row in the sidebar gets a small warning mark. Hover it and it tells you what went wrong and that your worktrees are being kept; click it and Orca tries the check again.
Trade-offs
This section is a safety disclosure. Read it as one.
A WSL repo whose directory was genuinely deleted will no longer prune. On a native host, a missing repo directory makes Git fail with
ENOENT, which stays classified as a true empty and still prunes. Under WSL the spawn cwd is the Windows interop directory, so the guest reportsbash: cd: …: No such file or directorywith exit 1 (measured onawin, see evidence) — which matches neither true-empty branch — and is classified as a failure →authoritative:false→ the repo's rows are retained. This is deliberate and now pinned by a test (retains a WSL repo whose guest directory is gone, and says why): the host side cannot verify a guest path's existence, and parsing a shell error message into "authoritatively gone" would re-open the laundering hole. What the user sees: the repo header shows the warning glyph with thebash: cd: … No such file or directoryreason and a retry; the rows stay until the user removes the repo in Orca or the directory comes back. Affects: WSL users who delete a repo directory outside Orca.Failed detected scans are not negatively cached, so a wedged host re-spawns
wsl.exeon every sequential detected-scan refresh.detected-worktree-scan-cache.ts:172-177writes the 5s TTL entry only afterawait scan.promiseresolves; a rejection only coalesces concurrent callers. Quantified: (a) a dead-distrowsl.exespawn costs ~30 ms onawin(evidence above), and every scan is serialised through the Git admission tiers; (b) theworktrees:listDetectedscan has no periodic driver — it runs at startup (session-referenced repos, then the deferred all-repo pass), onworktrees:changed/ repo-count / settings-focus events, and on explicit user actions (add repo, Retry scan, visibility dialogs); (c) theRUNTIME_WORKTREE_RECOVERY_REFRESH_DELAYS_MSburst named in the earlier version of this note goes throughsession.tabs.list→ the runtime's ownworktreeScanCache, which already caches a failed local scan for 30 s (worktree-ps-degraded-repo-scan.test.ts: caches a failed local scan instead of respawning Git on every poll), so it costs 1 spawn per repo per 30 s, not 5. Net: a handful of ~30 ms spawns per user-visible event in the failure state, which is not noticeable even on a slow box. Deliberately left as-is rather than adding a failure TTL: the user-driven Retry (P2) is the retry path, and a TTL would make it lie for its duration.Reduced scan coalescing on the success path. The detected scan previously ran
listWorktrees('lenient'), whose runner calls the sharedlistWorktreeGraph('graph'), so it shared one subprocess with every graph reader (registered-worktree-roots-cache.ts:57,hosted-review.ts:74/88,filesystem-source-control-ai-targets.ts:80) and with other lenient readers. The new'strict-true-empty'kind shares with neither, because a lenient joiner must not inherit a rejection and a strict joiner must not inherit[]. Cost while scans succeed: at most one extragit worktree listper repo per 5s TTL when a graph reader overlaps a detected scan, and zero when there is no overlap. Combined with item 2, that bound holds only while scans succeed.P1 diagnosability covers the
execFilepath only, not the streaming path.annotateWslHostFailureis imported solely bygit-exec-file.ts.git-stream-stdout.ts'sonClosestill buildsnew Error(`git exited with ${code}: ${stderr}`)with an emptystderr, and never captures stdout (it tracks onlystdoutBytes, streaming bytes tooptions.onStdout). That is verbatim the second field error shape from the investigation (Error: git exited with 4294967295: at ChildProcess.onClose), and it remains causeless after this PR.WSL_UTF8misses the network-git branch.git-exec-file.ts:65-67usesbuildNetworkSshPolicyEnvwhenuseConfiguredSshCommandForNetworkis set (runtime-remote-fetch-controller.ts:193), and that helper builds env viapromptGuardGitEnvdirectly (git-ssh-policy-env.ts:127), nevernonInteractiveGitEnv. WSL-routed fetch/push failures on Windows keep the pre-fix UTF-16 mojibake blindness.WSL_UTF8=1is assigned unconditionally on win32, overwriting any caller- or user-supplied value (git-process-env.ts:66-70usesnext.WSL_UTF8 = '1', not??=). Harmless today since nothing in-tree sets it, but it silently discards an explicitWSL_UTF8=0from the user's environment.WSL_UTF8=1is set for all Git on Windows, not just WSL-routed Git. The variable is only read bywsl.exe, so nativegit.exeis unaffected. The narrower alternative (threading the resolved command into the env builder) would have required restructuringgit-exec-file's env/resolution ordering.annotateWslHostFailuremutates the caughtError'smessage(prefix) rather than wrapping it. Deliberate:code,stdout,stderr, error identity and every existing message-substring classifier (isNotGitRepositoryError, the direct-Git fallbacks) keep working.error.stackstill shows the original head; the span head comes frommessageand does carry the diagnostic.The user-facing signal is a header glyph + tooltip, not a banner or notification. P2 surfaces the cause on the repo header of the retained rows with a click-to-retry; it does not toast, does not offer "reconfigure distro" inline (that lives in Project Settings → Windows runtime, one click away via the header menu), and is not shown for a non-authoritative listing that carries no reason (disconnected SSH host — the host section already says so; conflicting stored owner). The copy is the raw diagnostic (
wsl.exe host failure (distro "…"): … Wsl/Service/WSL_E_DISTRO_NOT_FOUND), not a friendly rewrite, because the code is what the user searches for. For an SSH repo whose provider call throws while connected, the glyph will show the provider error until the next successful scan.Remote wire:
unavailableReasonis a new optional field onDetectedWorktreeListResult, so an old client ignores it and a new client against an old host simply renders no glyph (the field is absent, notfalse). An old client paired to a new host now seesauthoritative:falsewhere it previously sawtruefor a failed scan — which is exactly the retention behaviour the old client's Fix silent data loss when workspace session hydration fails #1158 guard already implements. The runtime's ownlistDetected(runtime-managed-worktree-queries.ts) does not set the reason yet, so a runtime-hosted Windows repo with a dead distro is retained but un-badged (follow-up 5).worktrees:list/worktrees:listAllstill answer[]on a failed scan (they carry no authority flag on the wire). Unchanged by this PR — the retention decision is driven by the detected listing, not by these.Adversarial review
1 round(s), converged clean = true.
Round 1 — no blocking findings. The reviewer independently reproduced every claimed command: GREEN for both new test files (9 tests), and the revert-the-production-hunk experiment went RED exactly as claimed for both P0 (
expected true to be false, line 78) and P1 (WSL_UTF8undefined + missingWSL_E_DISTRO_NOT_FOUND) — confirming the tests are not theatre.pnpm tcandoxlintclean; the failures in the fullsrc/mainsweep were load flakes that pass individually and are unrelated to the diff.The reviewer also verified by source reading the mechanism the PR asserts but does not re-execute:
authoritative:falsegenuinely reaches and satisfies the #1158 retention guard (degraded-repo-worktree-validity.ts:52-77excludes the repo from bothrepoIdsWithLoadedWorktreesandrepoIdsWithAuthoritativeDetectedWorktrees),fetched-worktree-merge.ts:190keeps the visible rows,mergeDetectedWorktreesForHostpropagates the false flag rather than inheriting the priortrue, and every downstream purge site gates onauthoritative. TheisTrueEmptyWorktreeListingextraction is semantically byte-equivalent to the two lenient catches, the strict lister produces an identical row shape on success, SSH/folder/runtime routing is untouched, there is no new timer or unhandled-rejection path, and the runtime RPC twin (repo-worktree-resolution-scan.ts) was already strict so it needed no change. Verdict: not symptom-suppression — it removes a data-destroying misclassification whose chain the source investigation proved.Seven non-blocking findings, all ACCEPTED AS DISCLOSED LIMITATIONS rather than fixed in this PR. Each is written up in full in Trade-offs above; nothing was rebutted. Residual risk per item:
buildNetworkSshPolicyEnvmissesWSL_UTF8(Trade-off 5) — accepted; WSL-routed fetch/push on Windows keeps the mojibake blindness. Filed as a follow-up.WSL_UTF8assignment instead of??=(Trade-off 6) — accepted as harmless today (nothing in-tree sets it) and left as a one-line follow-up rather than churning the diff.Follow-ups
Pin the WSL deleted-repo-directory classification with a test.Done in this PR (retention kept, test added from the measured shape). A guest-side existence probe that could safely promote it to a true empty remains a possible later refinement.git-stream-stdout.ts'sonClosebuildsgit exited with ${code}: ${stderr}with an emptystderrand discards stdout (it countsstdoutBytesand forwards bytes tooptions.onStdout). Capture a bounded stdout tail on non-zero exit and run it throughreadWslHostFailureDiagnostic, so theError: git exited with 4294967295shape from the field bundle also carries a cause.buildNetworkSshPolicyEnvthroughnonInteractiveGitEnv(or addWSL_UTF8to it).git-ssh-policy-env.ts:127builds env frompromptGuardGitEnvdirectly, so theuseConfiguredSshCommandForNetworkbranch atgit-exec-file.ts:65-67(used byruntime-remote-fetch-controller.ts:193) misses the UTF-8 fix for WSL-routed fetch/push on Windows.Cache failed detected scans negatively.Measured and deliberately not done (Trade-off 2).runtime-managed-worktree-queries.tslistDetectedreturnsauthoritative: scan.okwithout a reason (itsscanRepocollapses the error to{ ok: false }), so a Windows repo served by a paired runtime is retained but shows no glyph. Thread the caught error throughRuntimeWorktreeScanResultand setunavailableReasonthere too.WSL_UTF8. One-liner:git-process-env.ts:69should usenext.WSL_UTF8 ??= '1'so an explicit user-set value is respected.'strict-true-empty'kind cannot share a subprocess with'lenient'or'graph'because the joiners disagree about how to treat a failure. A shared scan that returns a discriminated result (rows or the raw failure) and lets each joiner apply its own softening would recover the coalescing without re-introducing the laundering.