fix(tauri): own Windows CLI subtree with a job object#320
fix(tauri): own Windows CLI subtree with a job object#320shantur merged 2 commits intoNeuralNomadsAI:devfrom
Conversation
Keep the current graceful-then-force shutdown path, but stop relying on the tracked wrapper PID to reap descendants. Attach the CLI process to a Windows Job Object so closing the desktop-owned handle reliably tears down orphaned workspace processes even when the wrapper exits first.
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
I reviewed the latest PR state as a gatekeeper pass. I understood the request to be: review this PR for regressions, look for a stronger implementation if one exists, and call out anything that should block merge. Findings
Review outcome
Validation note
-- |
|
Do we need to align packages/electron-app similar to this change on Windows? |
|
I understood the question to be: should My answer is: not right now. Why:
So my gatekeeper take is:
Small caveat:
-- |
|
Sorry, I had accidentally included unrelated manifest changes in the PR earlier. I've cleaned that up now. |
|
Can you suggest a patch for packages/electron-app to match Tauri behavior on Windows |
|
I understood the request to be: suggest a concrete patch for My recommendation is:
Why this is the right patch:
Suggested patch shape
This is the same ownership model as the Tauri patch: the long-lived supervisor owns the job handle, so if Electron kills the supervisor or the supervisor dies unexpectedly, Windows reaps the whole subtree.
In Conceptually: if (process.platform === "win32") {
const supervisorPath = this.resolveWindowsJobSupervisorPath()
const payload = JSON.stringify({
command: process.execPath,
args: cliEntry.runner === "tsx"
? [cliEntry.runnerPath!, cliEntry.entry, ...args]
: [cliEntry.entry, ...args],
cwd: process.cwd(),
})
child = utilityProcess.fork(supervisorPath, [payload], {
stdio: "pipe",
serviceName: "CodeNomad CLI Job Supervisor",
})
this.childLaunchMode = "utility"
} else {
// keep existing path
}If
The stop path then becomes simpler and more reliable on Windows:
That means Where to patch
Minimal API for the helperInput: {
"command": "C:\\Path\\to\\node.exe",
"args": ["C:\\Path\\to\\server\\dist\\bin.js", "serve", "--host", "127.0.0.1"],
"cwd": "C:\\workspace\\CodeNomad"
}Behavior:
My gatekeeper recommendationIf you want Electron to truly match Tauri’s Windows semantics, this is the patch I would endorse. I would not endorse a TypeScript-only patch that just adds more Small suggestion, not part of this PR:
-- |
|
Thanks @pascalandr |
## Thanks for contributions - PR #262 “fix(server): show sane remote URLs for 0.0.0.0 binds” by @VooDisss - PR #270 “Implement shared compact split and unified tool-call diff layout” by @VooDisss - PR #272 “Add log level configuration support” by @bluelovers - PR #274 “perf(ui): fix O(n²) reactive subscriptions in timeline effects (HUGE SPEED IMPROVEMENT)” by @pascalandr - PR #285 “fix(ui): preserve prompt text when dismissing mention picker” by @app/codenomadbot - PR #291 “perf(ui): virtualize message timeline rendering, #274 follow-up ( BIG SPEED IMPROVEMENT )” by @pascalandr - PR #309 “fix(ui): stop forced auto-follow during streaming” by @VooDisss - PR #320 “fix(tauri): own Windows CLI subtree with a job object” by @pascalandr ## Highlights - **Remote access is much easier to use**: Connect to remote CodeNomad servers directly from the app and have full app experience remotely. - **Sidecars**: Open locally hosted services directly in CodeNomad. OpenVSCode Server, Terminal ( using ttyd ) and many more all available remotely and on the move. - **Background task notifications**: LLMs can now run background task asynchronously and be notified when the task is done. No need to wait or periodically checking the status. - **Long conversations are much smoother**: Large sessions and busy timelines render much faster, and chat scrolling behaves better while responses stream in. - **Clearer diffs and output views**: Tool-call diffs and session changes now render more consistently with improved split/unified layouts and support for unified diff patch formats. ## What’s Improved - **Big timeline performance gains**: The message timeline got two major performance passes, including virtualization, so large sessions stay responsive much longer. - **More useful context information**: Token stats are shown more clearly, and context window reporting is simpler to understand. - **Smoother voice and speech flows**: Speech input stays chained correctly, dictated text inserts more naturally into prompts, and voice mode state stays synced across listeners. - **More dependable desktop behavior**: Desktop auth isolation is safer per app, startup is more stable, and Windows process cleanup is more reliable. ## Fixes - **Less frustrating auto-scroll behavior**: Streaming reasoning, tool output, and oversized assistant replies no longer pull you to the bottom as aggressively, and you can toggle hold behavior for long replies. - **More reliable timeline previews**: Message preview tooltips now escape clipping so previews remain usable. - **Safer prompt editing**: Dismissing the mention picker no longer wipes your draft text. - **Better remote session stability**: Remote keyboard handling, reconnect flows, TLS exception scoping, and remote URL display are more predictable. - **Better small-screen and desktop polish**: The settings modal behaves better on phones, speech input stays pinned correctly, and Windows desktop builds handle CLI subprocess ownership more safely. ## Docs - **Refreshed project docs**: README and supporting presentation content were updated to better reflect the current product. ### Contributors - @pascalandr - @VooDisss - @bluelovers **Full Changelog**: v0.13.3...v0.14.0
Summary
KILL_ON_JOB_CLOSE, so the desktop app owns the whole subtree instead of relying only ontaskkill /PID <wrapper> /TRoot Cause
The previous Windows shutdown logic still depended on the PID tracked by Tauri. In practice that PID can be a short-lived Node wrapper. Once that wrapper exits,
taskkillcan report success or PID-not-found while descendants remain alive, and the desktop app no longer has a reliable handle to reap them.Validation
cargo check --manifest-path packages/tauri-app/src-tauri/Cargo.tomlcargo build --release --manifest-path packages/tauri-app/src-tauri/Cargo.toml