Skip to content

fix(relay): put the daemon in a kill-on-close job so a crash cannot orphan its PTY tree on Windows - #16895

Closed
brennanb2025 wants to merge 2 commits into
mainfrom
brennanb2025/sta5697-win-killjob
Closed

brennanb2025 wants to merge 2 commits into
mainfrom
brennanb2025/sta5697-win-killjob

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​103 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​103
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​55 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​55

In plain terms

Same story as the sibling PR, but for a nastier kind of death.

Orca runs a helper program on your remote machine to look after your terminals. Sometimes that helper doesn't get to shut down politely — it's force-killed, runs out of memory, or the machine loses power. In those cases it never runs any cleanup code, so nothing it might have been told to do on the way out will happen.

On Mac and Linux the operating system handles this for us: when the helper dies, your terminal programs get a hang-up signal and shut themselves down. Windows has no equivalent, so the leftovers just keep running — invisible to Orca, holding your project folder, piling up every time it happens.

This tells Windows up front: if I die, take everything I started with me. The operating system then enforces it, no matter how the helper dies.

Measured on a real Windows machine: before this change, a leftover program survived the helper being force-killed. After it, everything was cleaned up within about five seconds.

What you'll notice: on Windows remote machines, no more invisible leftover processes after a crash.

How the three PRs fit together

The original report (STA-5698) was: after the remote helper restarts, Orca might start your AI agent a second time while the first one is still running — two agents editing the same files at once.

That needs two ingredients:

  1. Leftover programs that survive the helper's death — otherwise there's no first agent left to collide with.
  2. Orca being unable to tell whether a remembered terminal name still means the same terminal — otherwise it wouldn't get confused in the first place.

These three PRs remove both ingredients rather than trying to detect the collision afterwards:

Removes Covers
#16894 ingredient 1 the helper crashing on an error
#16895 ingredient 1 the helper being force-killed, running out of memory, or losing power — Windows only, where the OS doesn't clean up for us
#16901 ingredient 2 terminal names that restart from 1 and get reused

Each stands alone and they can land in any order.

Why not just detect the collision? That was the first attempt (#16843, now closed). It tried to work out "has the helper been replaced?" by comparing how long it had been running against when Orca last saw the terminal. It couldn't tell a helper restart apart from the whole machine having rebooted — and after a reboot nothing survives, so there's nothing to protect against. It would have refused to restore your agent in a case that was completely safe. A live reproduction also failed to produce the collision at all on Linux: killing the helper took the agent down with it in 0.3 seconds.

So: prevent the leftovers, fix the names, and the problem doesn't arise instead of being guessed at.


The gap, measured on real hardware

On Windows build 26200, a process that owns a ConPTY and dies without running any handler leaves descendants behind:

Arm Parent Shell Descendant Result after taskkill /F on the parent
Baseline 51016 31380 84096 shell died, descendant survived
With one call first 94132 98012 30548 both gone at ~5s

The one call is assignCurrentProcessToJob(), which puts the calling process in a kill-on-close job so the kernel reaps its whole descendant tree when it dies. The addon comment says exactly that: it exists so a crashed host reaps its tree.

Why the relay does not already do this

Orca's patched node-pty has two job objects, and only one of them reaps:

  • a per-PTY job, created deliberately without JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE — with a measured reason in its comment: with that flag, typing exit in a pane also killed whatever the user had backgrounded. Untouched here.
  • a process-wide kill-on-close job, installed by assignCurrentProcessToJob.

On the desktop side the second one is already wired up (src/main/windows/windows-pty-job.ts). Nothing in src/relay/ calls it — so the relay, which is the process that owns PTYs on a Windows SSH host, has never been in one. That is a process leak on Windows remote hosts today, independent of any client-side behaviour.

The change

One call at relay startup, before any PTY can be created, win32 only.

It feature-detects and degrades, which is not hypothetical: during the hardware experiment one existing checkout's prebuilt addon exported the symbol and another did not. A missing export, a load failure, or a refused assignment is logged through relayLogLine and returns a distinct outcome — it never fails startup.

Why a relay-local module rather than importing the desktop helper

src/main/windows/windows-pty-job.ts feature-detects on terminateJob/listJobProcessIds, which are the symbols it needs. This path needs assignCurrentProcessToJob, and a prebuilt could carry one set without the other — so it checks the symbol it actually calls, and reports the three cases distinctly. Happy to collapse the two if reviewers prefer a shared loader.

Tests

src/relay/relay-windows-pty-job.test.ts covers assignment, the missing-export path, the refused path, load failure, non-win32 no-op, and startup ordering. Red before the change (the module did not exist), 8 green after.

Verification

pnpm tc, npx oxlint, the new test file, pnpm oxfmt, and pnpm build:relay all pass. Integrated with the sibling STA-5697 PR the relay suite shows no new failures — the two that fail also fail on origin/main.

Known limit

The unit test proves the relay attempts assignment and degrades cleanly. It cannot prove the tree is actually reaped, and this machine is macOS, so I could not confirm that this repo's own Windows prebuilt exports the symbol — only that the patched source does. If it does not, this degrades to a logged no-op rather than a fix. That check belongs on a Windows host before this is relied on.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Holding this from merge until Windows verification lands.

The unit tests prove the relay attempts assignment and degrades cleanly, but they cannot prove the tree is actually reaped, and this was written on macOS which cannot load Windows prebuilts. Specifically unverified:

  1. Does this repo's own Windows prebuilt export assignCurrentProcessToJob? Not hypothetical — during the hardware experiment that motivated this PR, one checkout's prebuilt exported it and another's did not. If ours does not, this PR is a logged no-op rather than a fix.
  2. Does the relay's startup path actually reach the call and get assigned back?

A verification run is in flight on a Windows host covering both, plus a baseline arm (hard-kill an owner without the call → does the tree orphan?) and the degrade path. Will post results here.

@brennanb2025
brennanb2025 marked this pull request as draft August 27, 2026 23:42
@coderabbitai

coderabbitai Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

Next included review available in 6 minutes.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f822404-f1f7-4ffd-82d8-7e15686644a0

📥 Commits

Reviewing files that changed from the base of the PR and between 86bedd1 and 557ce02.

📒 Files selected for processing (3)
  • src/relay/relay-daemon.ts
  • src/relay/relay-windows-pty-job.test.ts
  • src/relay/relay-windows-pty-job.ts

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: 1caf1451-70c7-4492-8c2d-6c1bb28f978b

📥 Commits

Reviewing files that changed from the base of the PR and between 551fbb9 and 9299e2f.

📒 Files selected for processing (3)
  • src/relay/relay-daemon.ts
  • src/relay/relay-windows-pty-job.test.ts
  • src/relay/relay-windows-pty-job.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The relay daemon now assigns its process to a Windows ConPTY kill-on-close job during startup, before socket ownership and channel setup. The new helper handles successful assignment, unavailable native support, native errors, and non-Windows platforms. Tests cover these outcomes and verify the helper’s startup position.

Merge Risk: 🔵 Low · up to 9299e

On Windows, the relay now attempts process-tree cleanup on crash, but installations where the native operation is unavailable or refused retain the existing orphan-process exposure. This is a bounded deployment/runtime risk requiring owner awareness or follow-up validation; the change is otherwise mergeable.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. 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.
Title check ✅ Passed The title clearly identifies the relay startup change, the kill-on-close job, the Windows scope, and the problem it prevents.
Description check ✅ Passed The description is detailed and covers the purpose, implementation, rationale, testing, platform scope, limitations, and linked issue context. It does not use the required template headings or explici…
Full details: Description check

Explanation

The description is detailed and covers the purpose, implementation, rationale, testing, platform scope, limitations, and linked issue context. It does not use the required template headings or explicitly include the required Visual Proof, AI Disclosure, Review, Agent skill boundary, Notes, and Checklist sections, but the core information is present.

✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • 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.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Verified on Windows hardware — build 26200

All four arms pass on this PR's exact commit (9299e2f9fa).

Arm 0 — the headline risk is clear. This repo's own Windows prebuilt does export the symbol:

assignCurrentProcessToJob = function
terminateJob              = function
listJobProcessIds         = function

loaded from the worktree's own patched node-pty (node_modules/.pnpm/[email protected]_patch_hash=…/build/Release/conpty.node). So this is not a no-op as shipped.

Arm 1 — baseline reconfirms the bug. Parent 132604 / shell 126320 / marker 48912 all alive; after taskkill /F /PID 132604 the shell was gone and marker 48912 survived — orphaned.

Arm 2 — the PR's own exported function fixes it. assignRelayProcessToKillOnCloseJob() returned assigned. Parent 29756 / shell 128292 / marker 52984; after the same hard kill, both the shell and the marker were gone.

Arm 3 — the degrade path is real, not theoretical. With a loader lacking the export it logged the diagnostic and returned unavailable rather than throwing.

All 12 created PIDs confirmed gone; no production files modified; the run found nothing contradicting the PR description.

Taking this out of draft.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review — PR #16895

Reviewed at head 557ce02299, rebased onto current main (83320bff9e). Rebases cleanly; pnpm tc clean; oxlint clean; git diff --check clean. Relay suite shows no new failures (the 2 that fail also fail on origin/main).

What's right

The premise is correct and I verified it: the relay does not share src/main/daemon/pty-subprocess/native-pty-spawn.ts, it has its own spawn path in pty-handler.ts, so nothing in src/relay/ has ever joined a kill-on-close job. That is a real Windows process leak today.

Feature detection is also genuinely sound — missing export, load failure, and refused assignment all degrade to a logged outcome and never fail startup. Ablation confirms every branch is pinned:

Hunk Ablated Result
daemon call site removed RED
platform !== 'win32' guard removed RED (2 tests)
typeof assignCurrentProcessToJob detection removed RED

Main finding: this reimplements something that already exists (P2)

src/main/windows/windows-pty-job.ts:157 already exports assignHostProcessToKillOnCloseJob() — feature-detected, memoized, and covered by windows-pty-job.test.ts:130-152. It is called from the desktop spawn path at native-pty-spawn.ts:34. This PR adds a parallel 53-line module doing the same thing, which is what AGENTS.md → "Reuse Before Reimplementing" exists to prevent.

The PR body gives two reasons for the fork. I checked both and neither holds:

  1. "A prebuilt could carry one set of symbols without the other." config/patches/[email protected]:786-788 exports terminateJob, listJobProcessIds, and assignCurrentProcessToJob on three consecutive lines of the same Init. They ship together or not at all. The observation behind this reason — one checkout exporting the symbol and another not — is patched vs. unpatched, which the shared loader already handles by returning false.

  2. Bundle compatibility. Moot: sibling PR fix(relay): reap owned PTYs when the daemon dies on an uncaught exception (STA-5697) #16894 already imports terminatePtyJob from that exact module into the relay bundle. It is proven importable from src/relay/.

Placement contradicts the incumbent's documented guidance (P2)

windows-pty-job.ts:140-142 says explicitly:

Call it from the pty spawn path, not from startup: resolving the native module loads the ConPTY addon, and paying that before the daemon publishes its endpoint delays readiness — the boot smoke test caught exactly that.

This PR calls it at the top of runRelayDaemon, before RelaySocketOwnership and before the endpoint is published. The relay also loads node-pty lazily by design (pty-handler.ts:506-525), which this front-loads on Windows.

Related: the ordering test at relay-windows-pty-job.test.ts:80-103 asserts placement by reading relay-daemon.ts as source text and comparing indexOf offsets. That cannot prove the call executes, and it actively cements the placement above — it will fight the spawn-path fix rather than catch a regression.

Suggested shape: delete relay-windows-pty-job.ts, call the existing assignHostProcessToKillOnCloseJob() from the relay's pty spawn path guarded by process.platform === 'win32' (mirroring native-pty-spawn.ts:32-35), and replace the source-text ordering test with one asserting the call happens before the first PTY is created. If the three-symbol detection granularity still bothers you, narrow the shared loader rather than forking it.

Windows observation — worth acting on regardless (residual risk)

I reached a real Windows host and probed the ConPTY addon a current worktree actually resolves:

CONPTY_EXPORTS = clear, connect, kill, resize, startProcess

None of assignCurrentProcessToJob, terminateJob, listJobProcessIds. That checkout's node_modules/node-pty is a symlink into another worktree's pnpm store at an older patch_hash, so this is a stale-install artifact, not evidence about what ships — I could not build a fresh Windows checkout to confirm the current patch's prebuilt, so this PR's own "Known limit" stands unresolved.

But it does demonstrate the failure mode is reachable, and that it is shared: when those symbols are absent, this PR logs and no-ops and #16894's Windows branch falls back to pty.kill(), which by #16894's own analysis does not reap the descendants that orphan. Both Windows protections vanish together, silently, behind one log line. A small integration test asserting the real prebuilt exports the three job symbols would turn that silent degradation into a build-time failure, and would have caught this immediately.

Not affected

No wire-format change (no RPC params, frames, or opcodes); no new live/unverifiable/exited producer — 'assigned' | 'unavailable' | 'not-applicable' is capability vocabulary, consistent with the incumbent terminatePtyJob's 'terminated' | 'unavailable'; no node:child_process import; no allowlist or baseline edited.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review — recommend SUPERSEDE (the gap is real; the implementation is not what we would write)

Rebased onto current main (94e7586665) and re-verified. Not pushed — the recommendation is a rewrite, so that is your call.

The earlier round's SUPERSEDE reasoning was wrong, and the gap is real

The prior conclusion was that assignHostProcessToKillOnCloseJob "already exists and is already called from native-pty-spawn.ts:34, i.e. on the pty spawn path." The function does exist (src/main/windows/windows-pty-job.ts:157, memoized, tested), but that call is in a different process. native-pty-spawn.ts belongs to src/main/daemon, the local app-side daemon. The relay daemon is a separate process (src/relay/relay.ts → runRelayDaemon) that spawns its PTYs through its own pty.spawn at src/relay/pty-handler.ts:1690 and never touches spawnNativeDaemonPty. So the relay daemon is genuinely never assigned to a kill-on-close job today. This PR is not redundant.

But the implementation duplicates a tested module for no gain

src/relay/relay-windows-pty-job.ts reimplements the native ConPTY loader rather than reusing the existing one, which AGENTS.md's "Reuse Before Reimplementing" rule is explicitly about. Cross-importing is already normal here — there are 63 from '../main/...' imports inside src/relay/, and #16894 adds a 64th from this very module. Behavioural differences, none of them improvements:

  • no caching of the resolved native module (canonical caches in cachedNative);
  • no memoization of the assignment (canonical guards with hostJobAssigned);
  • weaker feature detection — canonical requires terminateJob and listJobProcessIds; this checks only assignCurrentProcessToJob, so it can report assigned on a build the canonical loader considers unusable.

P1 — the only code path that runs in production is the only one never tested

Every one of the eight tests injects a fake loader (relay-windows-pty-job.test.ts:21,31,41,66,74). The default loadConptyNative is never invoked. That matters more than usual here, because it does a bare require('node-pty/lib/utils') — and the relay's own PTY loader documents that bare resolution is not reliable in the deployed bundle, falling back to a __dirname-anchored path for exactly that reason (pty-handler.ts:523-543, "tie module resolution to the deployed bundle dir, not cwd"). If that resolution fails on a real relay host, this degrades silently to 'unavailable' plus a log line, and no test or CI signal would ever show it. The feature could be dead on arrival on deployed relays.

Note this also removes the main argument for duplicating: the new module has the same resolution fragility as the canonical one, so it did not buy anything.

P2 — the startup call site contradicts the documented guidance

assignRelayProcessToKillOnCloseJob() runs at startup, before new RelaySocketOwnership(...). The canonical function's own doc (windows-pty-job.ts:140-142) says the opposite in as many words: "Call it from the pty spawn path, not from startup: resolving the native module loads the ConPTY addon, and paying that before the daemon publishes its endpoint delays readiness — the boot smoke test caught exactly that." In fairness, the readiness tests I could find cover src/main/daemon, not the relay, so the regression is plausible but unproven for the relay — I am not claiming I reproduced it.

The ordering test cements that placement: moving the call after RelaySocketOwnership goes red. It is also a source-text grep (readFileSync + indexOf ordering); its slice anchor function registerRelayStatus exists today, but if renamed, indexOf returns -1, the body becomes the rest of the file, and the test would most likely keep passing rather than fail.

What I would write instead

Delete relay-windows-pty-job.ts; import the existing memoized assignHostProcessToKillOnCloseJob and call it on the relay's PTY spawn path immediately before pty.spawn (pty-handler.ts:1690), guarded to win32 — mirroring native-pty-spawn.ts:33-35. That satisfies "before the first PTY", keeps the memoization, keeps the stricter feature detection, keeps the addon cost off the endpoint-publish path, and deletes ~53 lines. It should reuse the relay's hardened node-pty resolution rather than a bare specifier.

Gate-level ablation, each arm reverted ALONE

All eight arms are individually pinned — genuinely better test hygiene than #16894 had:

Arm Result
platform !== 'win32' early return RED
loadNative try/catch RED
typeof export guard RED
falsy → "assignment was refused" RED
call try/catch RED
relayLogLine in reportUnavailable RED
daemon call site RED
daemon call position RED

The caveat is that this pins the shape, not the behaviour that matters: the real loader is outside all of it.

Composition with #16894

They merge cleanly and compose semantically; combined tree is 28/28 on the targeted suites with pnpm tc clean. Worth noting they overlap on Windows — once the daemon is in a kill-on-close job, the OS reaps the tree on any death, including the ones uncaughtException never sees (SIGKILL, native abort, OOM). That makes this PR the stronger of the two on Windows and leaves #16894 carrying POSIX.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Addendum — P0: this is a no-op on every SSH remote, which changes the recommendation

A second pass surfaced something that outranks everything in my comment above. I verified it independently rather than taking it on report.

assignCurrentProcessToJob does not exist in the node-pty the relay actually installs

That symbol is added only by Orca's local pnpm patch — config/patches/[email protected]:786-788 adds terminateJob, listJobProcessIds, and assignCurrentProcessToJob to conpty.cc's Init, and it is wired as a patchedDependencies entry (package.json:323), so it applies to local node_modules only.

The relay deploys node-pty to the remote with a plain registry install — npm install --omit=dev [email protected] (ssh-relay-deploy.ts:989-1012) — followed by windowsNodePtyPatchCommand, which is JS-only: it rewrites lib/conpty_console_list_agent.js and never touches the native addon.

Empirically, against the published tarball:

npm pack [email protected]
grep -rl assignCurrentProcessToJob package/   -> 0 files
strings package/prebuilds/win32-x64/conpty.node   | grep -c assignCurrentProcessToJob -> 0
strings package/prebuilds/win32-arm64/conpty.node | grep -c assignCurrentProcessToJob -> 0

So on every Windows SSH remote, assignRelayProcessToKillOnCloseJob takes the typeof native?.assignCurrentProcessToJob !== 'function' branch at relay-windows-pty-job.ts:44, writes a degradation line to the relay log on every daemon start, and delivers zero orphan protection. The canonical module already anticipated exactly this: "a node-pty rebuilt from unpatched sources exports neither symbol" (windows-pty-job.ts:51-52). For the relay that is not an edge case, it is the permanent steady state.

This also settles the startup-placement question I hedged on

I said the readiness risk was "plausible but unproven for the relay." It is better evidenced than that. 3082e0ac82 ("fix(daemon): keep the host job off the startup path") records that assigning at startup "delayed readiness enough that daemon-boot-smoke failed on windows-latest, deterministically." That was against a 30s budget (daemon-boot-smoke.mjs:28, READY_TIMEOUT_MS = 30_000). This PR puts the same native-addon load in front of a 10s budget on the user's SSH-connect path (ssh-relay-deploy.ts:1483/:1719, Relay failed to start within 10s).

And the net that caught it does not extend here: daemon-boot-smoke.mjs boots out/main/daemon-entry.js and contains zero occurrences of "relay". There is no relay equivalent.

On a healthy host the load is likely tens to hundreds of ms and fits fine; the exposure is the tail (cold FS, AV scanning a freshly installed DLL, slow VM). But since the load currently buys nothing at all, the risk/benefit is negative regardless of how unlikely the tail is.

Correction to my ablation table above

Arms 7 and 8 are not independently pinned. Both redden the same single test, assigns exactly once before relay ownership or request handling begins. Each still goes red alone, so "individually pinned" holds literally — but the sharp consequence is that the one test pinning the call site's existence also cements its wrong position, so moving the call to the spawn path reddens the suite.

Revised recommendation

Patching is not enough, because the blocker is supply-chain rather than code: fixing the placement and reusing the canonical module still leaves a PR that does nothing on remotes.

  1. Close this PR rather than rewrite it.
  2. Land fix(relay): reap owned PTYs when the daemon dies on an uncaught exception (STA-5697) #16894 — on remotes it is the mechanism that actually reaps, since its portable requestForceKill path does not depend on the patched addon.
  3. Follow-up on the real blocker: all three job primitives are unavailable over SSH. Shipping a patched node-pty to remotes is the TODO(#1693) per-platform prebuilt work at ssh-relay-deploy.ts:950 — a different and much larger change.
  4. If a reduced version is still wanted later: delete relay-windows-pty-job.ts, import the canonical memoized assignHostProcessToKillOnCloseJob, call it win32-guarded immediately before pty.spawn at pty-handler.ts:1690, and replace the ordering test with one asserting the call precedes the first spawn rather than endpoint publish.

Worth noting for #16894 too: terminatePtyJob is dead on remotes for the same reason (terminateJob is also patch-only). It degrades correctly to unavailable and falls through to the portable path, which is exactly the contract that module documents — but the Windows job branch never fires on an SSH host.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closing on the P0 in the review above, which I verified independently rather than taking on report.

assignCurrentProcessToJob is added only by Orca's local pnpm patch (config/patches/[email protected], wired through patchedDependencies in package.json:323), so it exists in local node_modules only. The relay installs node-pty on the remote with a plain registry install (ssh-relay-deploy.ts:1000-1012) — with a TODO(#1693) directly above it about shipping prebuilt tarballs to avoid exactly that. So on every SSH remote this takes the typeof native?.assignCurrentProcessToJob !== 'function' branch, logs a degradation line on every daemon start, and delivers no orphan protection.

My Windows hardware verification was invalid and I should flag why. The run loaded the addon from node_modules/.pnpm/[email protected]_patch_hash=… — the patched local copy on that dev machine, not the relay's remotely-installed one. It proved the mechanism works given the patched addon; it never proved a relay on an SSH remote has that addon. The patched path was quoted verbatim in my own evidence and I did not register what it meant. The measurement was real, but it answered the wrong question.

Following the recommendation as given:

  1. Closing this rather than rewriting it — the blocker is supply-chain, not placement, so fixing the call site still leaves a PR that does nothing on remotes.
  2. fix(relay): reap owned PTYs when the daemon dies on an uncaught exception (STA-5697) #16894 stands: I re-read its reap path, and terminatePtyJob is only a win32 optimisation there — it always falls through to the portable requestForceKill, so it reaps on remotes regardless of the missing symbol.
  3. The real blocker (all three job primitives unavailable over SSH) is the TODO(#1693) per-platform prebuilt work, which is a much larger change and belongs in its own issue.

Also taking the process point: this PR reached 'ready' without an adversarial review loop, which is what caught it. Running that loop on the remaining PRs before treating any of them as ready.

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