Skip to content

fix(repo-identity): bound git remote-identity probes and retire them with their repo - #15196

Merged
nwparker merged 3 commits into
mainfrom
nwparker/sta-4452-bound-git-remote-identity-probes
Aug 18, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/sta-4452-bound-git-remote-identity-probes

Conversation

@nwparker

@nwparker nwparker commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​201 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​199
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​140 $\color{#cf222e}{\Huge{\mathbf{−}}}$​47 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​93

ELI5

Orca asks each repo "what remote are you on?" by running git remote -v in the background. That question had no deadline: if the folder lives on a hung network mount (or a wedged WSL distro), git never answers, the promise never settles, and the child process stays alive. Because the background pass walks repos one at a time, that one stuck repo stopped every other repo from ever being asked. Now the question has a deadline, and if you remove the repo we also cancel the question and forget it.

What Changed

src/main/repo-git-remote-identity.ts

  • probeGitRemoteIdentity / detectGitRemoteIdentity take an optional third arg { signal?, timeoutMs? }. Optional means no call site had to change, but it is not behaviour-neutral: repo-icon-autodetect.ts keeps its source unchanged and silently picks up the new 5s/20s deadlines. See Notes.
  • Local path: gitExecFileAsync(['remote','-v'], { cwd, timeout: 5000, signal }). 5000 is not invented — it matches LOCAL_GIT_READ_TIMEOUT_MS in src/main/git/git-username.ts:21, the budget used by the sibling username enrichment fired from the same IPC handler. No extra WSL headroom was added: a cut-off probe returns unavailable and retries on the enrichment TTL, so an early cut is cheap.
  • SSH path: forwards { signal, timeoutMs: 20_000 } to SshGitProvider.exec. Deliberately under the multiplexer's REQUEST_TIMEOUT_MS = 30_000 so the probe's own budget is the one that fires, and above a normal relay round trip.
  • The blanket catch is unchanged on purpose: a timeout or an AbortError maps to unavailable, never no-remote, so it can never clear an already-resolved identity.

src/main/repo-git-remote-identity-enrichment.ts

  • inFlightProbesByLocation now holds { controller, promise }. The .finally cleanup compares entry.controller against the local AbortController, so only the probe that owns the current entry may clear the location.
  • pruneRetryDeadlines became retireRemovedLocations: it still drops retry deadlines for locations with no live repo, and now also aborts and deletes their in-flight probe entries. The stale "a probe still running for a dropped repo needs no exemption" comment is gone.
  • Retirement moved out of the sweep body into the public entry point, before the in-flight guard. A wedged sweep is exactly the case where retirement matters, so it must not sit behind the guard.
  • The retired-probe guard keys off controller.signal.aborted, not a rejection: probeGitRemoteIdentity swallows the AbortError and resolves { status: 'unavailable' }, so a catch would never see it. There is a comment saying so, to stop a future "simplification".
  • Added the sweep-level concurrency guard that was missing, mirroring enrichRepoGitUsernames' enrichmentInFlight + rerunRequested (src/main/repo-git-username-enrichment.ts:22-23, 69-86). repos:list, projects:list and projectHostSetups:list now coalesce into one pass plus at most one queued follow-up.
  • Because sweeps now coalesce across call sites with different onChanged callbacks (the IPC handlers broadcast; the runtime RPC path also drops a resolved-worktree cache), pending listeners are collected in a set and all of them are notified by the pass that lands a change. The set is cleared only when the sweep chain quiesces, so it cannot drop a caller whose own call queued the follow-up.
  • The set dedupes by function identity, so callers must pass a stable reference — otherwise it grows one entry per list IPC for the length of a chain that never quiesces (exactly the wedge case this PR is about) and multiplies the repos:changed broadcast by the same factor. Both call sites were allocating a fresh closure per call, so they were hoisted: broadcastReposChanged in registerRepoHandlers (shared by repos:list, projects:list, projectHostSetups:list, and the adjacent username enrichment) and a readonly arrow field on OrcaRuntimeService. The set is now bounded by the number of distinct call sites (2).
  • retireRemovedLocations(store.getRepos()) runs synchronously in the exported entry point, so it is wrapped in a try/catch that logs: the entry point is fire-and-forget and could not throw into an IPC handler before, when retirement ran inside the pass's .catch-guarded async body.
  • Test helpers: flush...ForTests awaits the sweep chain then the entry promises; reset...ForTests aborts every controller before clearing.

Why

The load-bearing bug is the missing local deadline, not a missing removal hook. After a repo is removed its location is no longer a candidate (selectEnrichmentCandidates filters store.getRepos()), so later sweeps do not short-circuit into the dead entry. The user-visible symptom — one wedged location stalling enrichment for every other repo — happens while the repo is still live, with no removal involved. Post-removal residue is a leaked map entry, promise and child process, which only re-poisons enrichment if the identical connectionId\0path is added back. So: the timeout is the fix; abort-on-removal is defense in depth; the sweep guard stops list IPCs from stacking passes behind a slow probe.

Real triggers for the wedge are a hung NFS/SMB cwd (the path walk itself blocks before git does anything) and wsl.exe -d <distro> against a wedged distro on Windows. git remote -v reads config only and never invokes a credential helper, so credential prompting is not a trigger.

The SSH path was already bounded before this PR — SshGitProvider.exec -> requestGitStreamable -> mux.request with REQUEST_TIMEOUT_MS = 30_000 plus STREAM_INACTIVITY_TIMEOUT_MS. The unbounded case was local/WSL only. The signal and timeout are still forwarded on the SSH path so abort-on-removal works there too.

Wire compatibility: nothing new goes on the wire. Cancellation does not ride rpc.cancel; requestGitStreamable wires options.signal and its cancel() sends the existing git.cancelResponseStream notify, and only once a real streamId exists. No new opcode, so no capability negotiation is needed. timeoutMs is consumed client-side by mux.request.

Applies equally to folder workspaces (they are filtered out of enrichment, unchanged) and to git worktrees.

Linked Issue

STA-4452 — "Removed repos can leave stalled remote-identity probes alive". Follow-up to #14414.

Fixes #

Visual Proof

N/A — main-process only. No renderer, layout, or user-visible surface changes; the only observable difference is fewer redundant repos:changed broadcasts.

Testing

npx oxlint src/main/repo-git-remote-identity.ts src/main/repo-git-remote-identity-enrichment.ts \
           src/main/repo-git-remote-identity.test.ts src/main/repo-git-remote-identity-enrichment.test.ts \
           src/main/ipc/repos.ts src/main/runtime/orca-runtime.ts                                          # clean
npx tsc --noEmit -p config/tsconfig.node.json                                                               # clean
npx vitest run --config config/vitest.config.ts \
  src/main/repo-git-remote-identity.test.ts src/main/repo-git-remote-identity-enrichment.test.ts \
  src/main/repo-icon-autodetect.test.ts src/main/runtime/rpc/methods/repo.test.ts                           # 68 passed
npx vitest run --config config/vitest.config.ts \
  src/main/ipc/repos-local-add-and-project-setup.test.ts src/main/ipc/repos-remote-git-username.test.ts \
  src/main/ipc/repos-remote-client-events.test.ts                                                          # 22 passed

Vacuity check: source changes stashed (both .ts files reverted, tests kept), same vitest command re-run — 8 failed / 60 passed.

The coalescing test passes a shared reference twice (modelling repos:list and projects:list, which now share broadcastReposChanged) plus a distinct runtime reference. The shared one is what detects a pass running per call; the distinct one is what detects a coalesced caller being dropped. Three distinct spies would not fail without the fix, because the pre-fix code gives each stacked pass its own single callback and the in-flight probe map already dedupes the probes.

Test Without the fix
bounds the local probe with a deadline and forwards the caller signal FAIL — gitExecFileAsync called with { cwd } only
bounds the SSH probe under the relay request timeout and forwards the caller signal FAIL — exec called with 2 args, no options
reports unavailable when a connected SSH provider cannot reach the host (updated) FAIL — no options arg forwarded
schedules remote identity enrichment without blocking the caller (updated) FAIL — probe called without a signal
aborts the in-flight probe of a repo that was removed FAIL — probe call 0 was made without an abort signal
probes again when the same location is re-added after its probe was retired FAIL — expected 2 probe calls, got 1 (second sweep returns the dead promise)
does not let a retired probe write an identity or re-seed a retry deadline FAIL — expected 2 probe calls, got 1 (the retired probe re-seeded a deadline)
coalesces concurrent sweeps instead of running one pass per list call FAIL — the shared list-handler listener is called 3 times instead of 1

Three tests pass on both sides and are there as behavior guards, not regression tests, and are labelled as such here so no one mistakes them for proof:

  • maps a timed-out local probe to unavailable, never no-remote
  • maps an aborted probe to unavailable, never no-remote
  • still notifies a caller whose sweep was coalesced into one already running (it would fail against the naive coalescing implementation that keeps only the first caller's onChanged, which is why it is worth having)

The regression test for the never-settling probe deliberately does not call flushRepoGitRemoteIdentityEnrichmentForTests before retirement — that helper awaits the in-flight promises and would hang the suite rather than fail. It asserts synchronously on the abort signal instead.

  • I manually tested these changes locally — automated only; the wedge itself (hung NFS mount / wedged WSL distro) was not reproduced on hardware. See Notes.
  • Automated tests added/updated

AI Disclosure

Claude Opus.

Review

Start with probeGitRemoteIdentity — everything else follows from giving it a deadline. Then retireRemovedLocations and the controller.signal.aborted guard in enrichRepoGitRemoteIdentity. The listener set in enrichMissingRepoGitRemoteIdentities is the least obvious part: it exists only because coalescing merges callers whose onChanged do different work.

Agent skill upstream boundary

  • Not applicable.

Notes

Deliberately scoped out:

  • No hardware repro of the hung NFS/SMB mount or the wedged WSL distro. The defect and the fix are argued from the code path (runner.ts only arms its kill timer when options.timeout > 0) and covered by unit tests, not by an end-to-end wedge.
  • STA-4350's retry-deadline map is untouched — already fixed by fix(repos): forget remote-identity deadlines for removed repo locations #14672 (3a4da06).
  • repo-icon-autodetect.ts still calls detectGitRemoteIdentity with no options. Its source is unchanged, but its behaviour is not: it now inherits the 5s/20s defaults. It still passes no cancellation signal; giving it a caller-scoped signal is a separate change.
  • No timeout was added to any other caller of SshGitProvider.exec.
  • Security: no new IPC surface, no new wire fields, no user input reaches a shell.
  • Performance: strictly fewer subprocesses and fewer repos:changed broadcasts than before.
  • Blast radius beyond the two identity files: src/main/ipc/repos.ts and src/main/runtime/orca-runtime.ts each hoist an existing onChanged closure to a stable reference. No behaviour change on either, other than the deduplication the enrichment set now performs.
  • Backwards compatibility: the new probe options are optional; a client on this build talking to an older relay behaves the same, since timeoutMs and signal are handled entirely on the client side of the mux.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Targeted lint, typecheck, and vitest run locally (full suite left to CI)

…with their repo

The local `git remote -v` probe ran with no timeout and no signal, and the
runner only arms its kill timer when a timeout is passed, so a hung NFS/SMB
cwd or a wedged `wsl.exe -d <distro>` left the promise unsettled and the child
alive. Because the sweep is sequential and dedupes per location, that one
wedged location stalled enrichment for every other repo.

- probeGitRemoteIdentity/detectGitRemoteIdentity take `{ signal, timeoutMs }`;
  local reads get the 5s background local-git-read budget, SSH gets a budget
  under the relay's 30s request timeout. Timeouts/aborts still map to
  `unavailable`, never `no-remote`, so they cannot clear a resolved identity.
- In-flight probes are tracked with an AbortController and retired (aborted +
  dropped) when their location is no longer backed by a repo, so a re-added
  repo is not poisoned by the dead entry and a retired probe cannot re-seed a
  retry deadline.
- Added the missing sweep-level guard so repos:list / projects:list /
  projectHostSetups:list coalesce into one pass instead of stacking one
  sequential sweep per list IPC.

STA-4452
@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 55cf6fa7-e62a-4010-8e5d-a7b04efc4b58

📥 Commits

Reviewing files that changed from the base of the PR and between 159a1d9 and 4a65c9a.

📒 Files selected for processing (1)
  • src/main/runtime/orca-runtime.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/runtime/orca-runtime.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Remote identity probes now accept abort signals and bounded timeouts for local and SSH execution. Probe failures map to unavailable. Enrichment cancels probes for removed repositories, prevents stale results, refreshes resolved identities, and coalesces concurrent sweeps. Queued callers receive change notifications after the sweep chain completes. Tests cover timeout propagation, cancellation, re-probing, stale-result handling, retry deadlines, and notification behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description covers the required sections, explains the change and rationale, identifies STA-4452, documents testing, and addresses compatibility and risk considerations.
Title check ✅ Passed The title clearly and concisely summarizes the primary change: bounded Git remote-identity probes and retirement after repository removal.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 212bef1a-c4e8-4f93-9b88-63388211daba

📥 Commits

Reviewing files that changed from the base of the PR and between 6ee265e and deba4c0.

📒 Files selected for processing (4)
  • src/main/repo-git-remote-identity-enrichment.test.ts
  • src/main/repo-git-remote-identity-enrichment.ts
  • src/main/repo-git-remote-identity.test.ts
  • src/main/repo-git-remote-identity.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 6 remain after this review.

Comment on lines +208 to +210
for (const listener of pendingChangeListeners) {
listener()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Continue notification after a listener fails.

If one pendingChangeListeners callback throws, the loop stops. The outer .catch() logs the error, but later callers do not receive onChanged. This breaks the requirement to notify all queued callers.

Catch and log each listener error inside the loop. Add a test where the first listener throws and the second listener still runs.

Proposed fix
   if (changed) {
     for (const listener of pendingChangeListeners) {
-      listener()
+      try {
+        listener()
+      } catch (error) {
+        console.error('[repo-identity] Failed to notify identity enrichment listener:', error)
+      }
     }
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for (const listener of pendingChangeListeners) {
listener()
}
for (const listener of pendingChangeListeners) {
try {
listener()
} catch (error) {
console.error('[repo-identity] Failed to notify identity enrichment listener:', error)
}
}

Comment on lines +88 to +90
const [, options] = vi.mocked(gitExecFileAsync).mock.calls[0]
expect(options.timeout).toBeGreaterThan(0)
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert the required timeout values.

The local assertion accepts any positive value. The SSH assertion accepts any value below 30 seconds. Both tests pass if the required five-second local or 20-second SSH budget changes.

Assert 5_000 for the local probe and 20_000 for the SSH probe.

Also applies to: 104-105

Comment on lines +14 to +16
export type GitRemoteIdentityProbeOptions = {
signal?: AbortSignal
timeoutMs?: number

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 3 --glob '*.ts' '\bprobeGitRemoteIdentity\s*\(' src
rg -n -C 3 --glob '*.ts' 'timeoutMs\s*:' src/main

Repository: stablyai/orca

Length of output: 50370


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- src/main/repo-git-remote-identity.ts ---'
wc -l src/main/repo-git-remote-identity.ts
ast-grep outline src/main/repo-git-remote-identity.ts
sed -n '1,220p' src/main/repo-git-remote-identity.ts

printf '%s\n' '--- related symbols ---'
rg -n -C 5 --glob '*.ts' \
  'prepareWslLinkedWorktreeGitRouting|execFileCapture|SSH_PROBE_TIMEOUT_MS|LOCAL_PROBE_TIMEOUT_MS|GitRemoteIdentityProbeOptions|probeGitRemoteIdentity' \
  src/main

Repository: stablyai/orca

Length of output: 50370


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- runner entry points ---'
rg -n -C 8 --glob '*.ts' \
  'export (async )?function gitExecFileAsync|function gitExecFileAsync|gitExecFileAsync\s*=|export (async )?function execFileCapture|function execFileCapture' \
  src/main/git src/main

printf '%s\n' '--- WSL routing implementation and timeout ---'
sed -n '1,330p' src/main/git/wsl-linked-worktree-git-routing.ts

printf '%s\n' '--- exact timeout assertions ---'
sed -n '70,108p' src/main/repo-git-remote-identity.test.ts

printf '%s\n' '--- JavaScript nullish/default behavior ---'
node - <<'JS'
const values = [undefined, null, 0, -1, NaN, Infinity, -Infinity, 1]
for (const value of values) {
  const local = value ?? 5000
  const ssh = value ?? 20000
  console.log(String(value), JSON.stringify({ local, ssh, finite: Number.isFinite(value), positiveFinite: Number.isFinite(value) && value > 0 }))
}
JS

Repository: stablyai/orca

Length of output: 17690


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- execFileCapture implementation ---'
sed -n '560,700p' src/main/git/runner.ts

printf '%s\n' '--- gitExecFileAsync implementation ---'
sed -n '1046,1152p' src/main/git/runner.ts

printf '%s\n' '--- option type definitions ---'
rg -n -C 6 --glob '*.ts' \
  'type ExecFileCaptureOptions|interface ExecFileCaptureOptions|type GitExecOptions|interface GitExecOptions|timeout\??:|timeoutMs\??:' \
  src/main/git/runner.ts src/main

printf '%s\n' '--- exact local call text ---'
sed -n '27,48p' src/main/repo-git-remote-identity.ts

Repository: stablyai/orca

Length of output: 50370


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- src/main/git/runner.ts: capture implementation ---'
sed -n '603,680p' src/main/git/runner.ts

printf '%s\n' '--- src/main/git/runner.ts: gitExecFileAsync implementation ---'
sed -n '1050,1152p' src/main/git/runner.ts

printf '%s\n' '--- src/main/git/runner.ts: relevant option declarations ---'
rg -n -m 12 -C 4 \
  'ExecFileCaptureOptions|GitExecOptions|timeout\??:|timeoutMs\??:' \
  src/main/git/runner.ts

Repository: stablyai/orca

Length of output: 9639


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- timeout handling in execFileCapture ---'
sed -n '650,770p' src/main/git/runner.ts

printf '%s\n' '--- timeout-related constants and call sites ---'
rg -n -m 30 -C 3 \
  'timeout|setTimeout|killSpawnedCommandTree' \
  src/main/git/runner.ts | sed -n '1,220p'

Repository: stablyai/orca

Length of output: 2965


Reject timeout overrides that remove the deadline.

timeoutMs: 0, negative values, NaN, and non-finite values bypass ?? and disable the probe deadline. Normalize invalid values to the backend default before passing timeout to gitExecFileAsync or timeoutMs to the SSH provider. Add tests for these values.

Comment on lines +38 to +42
: await gitExecFileAsync(['remote', '-v'], {
cwd: repoPath,
timeout: options.timeoutMs ?? LOCAL_PROBE_TIMEOUT_MS,
signal: options.signal
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 8 --glob '*.ts' '\bprepareWslLinkedWorktreeGitRouting\b' src/main
rg -n -C 8 --glob '*.ts' '\bexecFileCapture\b' src/main/git

Repository: stablyai/orca

Length of output: 50369


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- WSL routing implementation ---'
sed -n '1,80p' src/main/git/wsl-linked-worktree-git-routing.ts
sed -n '220,340p' src/main/git/wsl-linked-worktree-git-routing.ts

printf '%s\n' '--- runner execution path ---'
sed -n '1025,1125p' src/main/git/runner.ts

printf '%s\n' '--- probe caller and timeout handling ---'
sed -n '1,90p' src/main/repo-git-remote-identity.ts
rg -n -C 6 'LOCAL_PROBE_TIMEOUT_MS|timeoutMs|gitExecFileAsync' src/main/repo-git-remote-identity.ts src/main/git/runner.ts

Repository: stablyai/orca

Length of output: 17418


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- WSL option types and timeout logic ---'
rg -n -C 12 'type WslLinkedWorktreeRoutingOptions|interface WslLinkedWorktreeRoutingOptions|WSL_LINKED_WORKTREE_ROUTE_PROBE_TIMEOUT_MS|setTimeout|signal|AbortSignal' src/main/git/wsl-linked-worktree-git-routing.ts

printf '%s\n' '--- execFileCapture implementation and timeout propagation ---'
rg -n -C 18 'function execFileCapture|const execFileCapture|export async function execFileCapture|execFile\(' src/main/git/runner.ts src/main/git

Repository: stablyai/orca

Length of output: 17098


Use one deadline for WSL preparation and Git execution.

prepareWslLinkedWorktreeGitRouting has its own 5-second timer, but the local timeout starts only after preparation. A stalled route probe can therefore consume 5 seconds and Git can consume another 5 seconds. Pass a shared remaining deadline.

…caller references

Every call site allocated a fresh onChanged closure, so the Set that notifies
coalesced sweeps deduped nothing: during a chain that never quiesces it grew one
entry per list IPC and multiplied the repos:changed broadcast. Hoist the closures
to stable references in ipc/repos.ts and OrcaRuntimeService, and state the
contract on the set.

Also: guard the synchronous retirement call so the fire-and-forget entry point
keeps its no-throw contract, drop the placeholder promise in favour of building
the in-flight entry in one shot, and make the coalescing test use a shared list
reference plus a distinct runtime reference so it detects both stacked passes and
a dropped caller.
@nwparker
nwparker merged commit e39def3 into main Aug 18, 2026
87 of 89 checks passed
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 21, 2026
…with their repo (stablyai#15196)

* fix(repo-identity): bound git remote-identity probes and retire them with their repo

The local `git remote -v` probe ran with no timeout and no signal, and the
runner only arms its kill timer when a timeout is passed, so a hung NFS/SMB
cwd or a wedged `wsl.exe -d <distro>` left the promise unsettled and the child
alive. Because the sweep is sequential and dedupes per location, that one
wedged location stalled enrichment for every other repo.

- probeGitRemoteIdentity/detectGitRemoteIdentity take `{ signal, timeoutMs }`;
  local reads get the 5s background local-git-read budget, SSH gets a budget
  under the relay's 30s request timeout. Timeouts/aborts still map to
  `unavailable`, never `no-remote`, so they cannot clear a resolved identity.
- In-flight probes are tracked with an AbortController and retired (aborted +
  dropped) when their location is no longer backed by a repo, so a re-added
  repo is not poisoned by the dead entry and a retired probe cannot re-seed a
  retry deadline.
- Added the missing sweep-level guard so repos:list / projects:list /
  projectHostSetups:list coalesce into one pass instead of stacking one
  sequential sweep per list IPC.

STA-4452

* refactor(repo-identity): bound the enrichment listener set to stable caller references

Every call site allocated a fresh onChanged closure, so the Set that notifies
coalesced sweeps deduped nothing: during a chain that never quiesces it grew one
entry per list IPC and multiplied the repos:changed broadcast. Hoist the closures
to stable references in ipc/repos.ts and OrcaRuntimeService, and state the
contract on the set.

Also: guard the synchronous retirement call so the fire-and-forget entry point
keeps its no-throw contract, drop the placeholder promise in favour of building
the in-flight entry in one shot, and make the coalescing test use a shared list
reference plus a distinct runtime reference so it detects both stacked passes and
a dropped caller.
dallascrilley pushed a commit to dallascrilley/orca that referenced this pull request Aug 27, 2026
…with their repo (stablyai#15196)

* fix(repo-identity): bound git remote-identity probes and retire them with their repo

The local `git remote -v` probe ran with no timeout and no signal, and the
runner only arms its kill timer when a timeout is passed, so a hung NFS/SMB
cwd or a wedged `wsl.exe -d <distro>` left the promise unsettled and the child
alive. Because the sweep is sequential and dedupes per location, that one
wedged location stalled enrichment for every other repo.

- probeGitRemoteIdentity/detectGitRemoteIdentity take `{ signal, timeoutMs }`;
  local reads get the 5s background local-git-read budget, SSH gets a budget
  under the relay's 30s request timeout. Timeouts/aborts still map to
  `unavailable`, never `no-remote`, so they cannot clear a resolved identity.
- In-flight probes are tracked with an AbortController and retired (aborted +
  dropped) when their location is no longer backed by a repo, so a re-added
  repo is not poisoned by the dead entry and a retired probe cannot re-seed a
  retry deadline.
- Added the missing sweep-level guard so repos:list / projects:list /
  projectHostSetups:list coalesce into one pass instead of stacking one
  sequential sweep per list IPC.

STA-4452

* refactor(repo-identity): bound the enrichment listener set to stable caller references

Every call site allocated a fresh onChanged closure, so the Set that notifies
coalesced sweeps deduped nothing: during a chain that never quiesces it grew one
entry per list IPC and multiplied the repos:changed broadcast. Hoist the closures
to stable references in ipc/repos.ts and OrcaRuntimeService, and state the
contract on the set.

Also: guard the synchronous retirement call so the fire-and-forget entry point
keeps its no-throw contract, drop the placeholder promise in favour of building
the in-flight entry in one shot, and make the coalescing test use a shared list
reference plus a distinct runtime reference so it detects both stacked passes and
a dropped caller.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…with their repo (stablyai#15196)

* fix(repo-identity): bound git remote-identity probes and retire them with their repo

The local `git remote -v` probe ran with no timeout and no signal, and the
runner only arms its kill timer when a timeout is passed, so a hung NFS/SMB
cwd or a wedged `wsl.exe -d <distro>` left the promise unsettled and the child
alive. Because the sweep is sequential and dedupes per location, that one
wedged location stalled enrichment for every other repo.

- probeGitRemoteIdentity/detectGitRemoteIdentity take `{ signal, timeoutMs }`;
  local reads get the 5s background local-git-read budget, SSH gets a budget
  under the relay's 30s request timeout. Timeouts/aborts still map to
  `unavailable`, never `no-remote`, so they cannot clear a resolved identity.
- In-flight probes are tracked with an AbortController and retired (aborted +
  dropped) when their location is no longer backed by a repo, so a re-added
  repo is not poisoned by the dead entry and a retired probe cannot re-seed a
  retry deadline.
- Added the missing sweep-level guard so repos:list / projects:list /
  projectHostSetups:list coalesce into one pass instead of stacking one
  sequential sweep per list IPC.

STA-4452

* refactor(repo-identity): bound the enrichment listener set to stable caller references

Every call site allocated a fresh onChanged closure, so the Set that notifies
coalesced sweeps deduped nothing: during a chain that never quiesces it grew one
entry per list IPC and multiplied the repos:changed broadcast. Hoist the closures
to stable references in ipc/repos.ts and OrcaRuntimeService, and state the
contract on the set.

Also: guard the synchronous retirement call so the fire-and-forget entry point
keeps its no-throw contract, drop the placeholder promise in favour of building
the in-flight entry in one shot, and make the coalescing test use a shared list
reference plus a distinct runtime reference so it detects both stacked passes and
a dropped caller.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant