Repository navigation
fix(windows): unblock structured native chat by exposing process creation time - #18986
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe Windows process-tree addon now retrieves and exposes process creation times in Unix milliseconds. Process enumeration continues beyond 1024 entries. The addon reports its supported process-data flags. Build scripts repair and validate the patched sources and native binary. Windows process-table logic checks the reported capability bitmask. Tests and documentation cover patched and stale addon behavior. Merge Risk: 🟡 Moderate · up to Windows process-tree enumeration now supplies creation times, but a PID reused during collection can be misidentified as a descendant and lead cleanup to target an unrelated process. Resolve the snapshot consistency issue before merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description gives a detailed technical explanation and validation summary, but it does not follow the required template. It omits the required Linked Issue, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections, and it does not provide the required visual-proof statement for this behavior change. Resolution Add all required template sections. Include a real issue reference after Full details: Docstring CoverageExplanation Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 11 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches 💡 1📝 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.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 67bdb106-f350-4aaa-a7ce-48b9bbaf6214
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
.github/workflows/pr.ymlconfig/patches/@[email protected]config/scripts/build-windows-process-tree-relay-addon.mjsconfig/scripts/pr-code-change-scope.mjssrc/main/windows/windows-process-table-native-addon.win32.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
@vscode/[email protected]patch — Adds aCreationTime = 4data flag and acreationTimeMsfield across the native snapshot (process.h/process.cc), worker emission (process_worker.cc), the shippedlib/index.jsenum, and the typings, matching the valuewindows-process-table.tsalready reads.- Relay addon build script — Extends
applyWindowsProcessTreeBuildFixesto repair un-applied creation-time hunks andassertPatchAppliedto verify them, so a relay binary compiled from a partially-patched package cannot silently omit the field. - Real-addon guard test — A Windows-only test that asserts
isWindowsProcessStartTimeAvailable()is true and that a fresh snapshot actually carriescreationTimeMsrows, pinning both the enum and the native binary rather than only one. - CI wiring — Registers the test in the Windows job and the change-scope map, and bumps the patch hash in
pnpm-lock.yaml(sha256 verified to match the patch file).
ℹ️ Creation-time patch is encoded in three places
The patch content now lives in the .patch file, the repairCreationTimeSources() rewrite, and the assertPatchApplied() verification strings. That redundancy is load-bearing — it is what keeps a relay binary from shipping stale when pnpm materializes the CRLF package without applying the patch — but a future native edit (renaming GetProcessCreationTime, changing the epoch math, adjusting the emission guard) now has to be synced across three sites by hand. No action needed for this PR; flagging so the next change to this addon knows to keep them in lockstep.
Technical details
# Creation-time patch has three sources of truth
## Affected sites
- config/patches/@[email protected] — authoritative pnpm patch
- config/scripts/build-windows-process-tree-relay-addon.mjs:112 `repairCreationTimeSources()` — JS reimplementation applied before build
- config/scripts/build-windows-process-tree-relay-addon.mjs:92 `assertPatchApplied()` — substring checks run after repair
## Open questions for the human
- Is the repair+verify redundancy worth maintaining vs. trusting pnpm and letting the build fail loudly on a missing hunk?DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Extended the relay bare-addon reader to request creation times —
readNativeRowsnow asks forCommandLine | CreationTime(flag 6) on the relay addon path as well as the desktop package path, so a relay host's own teardown and identity probe can PID-reuse-safely re-identify descendants instead of treating every row as a bare pid. - Named
CreationTime: 4in the relay'sPROCESS_DATA_FLAG— documented why the bit is hardcoded rather than probed on the relay path (content-hashed artifact shipped in the same immutable relay directory as the bundle). - Tightened the real-addon guard test — asserts the querying process's own row carries a creation time bounded by
2020-01-01andDate.now(), so a raw FILETIME or unconverted 100ns tick can no longer satisfy the check. - Updated the relay-reader unit test and enumeration docs — the injected-addon test now expects flag 6 and
isWindowsProcessStartTimeAvailable() === true, and the docs reflect the newcreationTimeMscapability.
The extension is well-reasoned: isWindowsProcessStartTimeAvailable() returning true on the relay is inert (its only consumers require LOCAL_EXECUTION_HOST_ID), and the teardown/identity consumers read actual row fields and fail safe when creationTimeMs is absent, so a stale addon cannot fail open.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
♻️ Duplicate comments (1)
config/scripts/build-windows-process-tree-relay-addon.mjs (1)
257-257: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winFix the TypeScript destructuring repair.
Line 257 matches the JavaScript parameter shape only. It does not match
children }: IProcessInfoNodeinlib/index.ts.When the repair path runs, lines 259-262 add
creationTimeMs,to the returned object without adding it to the TypeScript destructuring.lib/index.tsthen references an undeclared identifier, andassertPatchApplied()still passes.Proposed fix
- next = next.replace(/(memory, commandLine)( \}, children \})/, '$1, creationTimeMs$2') + const buildNodeDestructure = isTs + ? /(memory, commandLine)( \}, children \}:)/ + : /(memory, commandLine)( \}, children \})/ + next = next.replace(buildNodeDestructure, '$1, creationTimeMs$2')
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 3cfb0d81-b0c0-4e39-8d08-a560aa4ef978
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (10)
config/patches/@[email protected]config/scripts/build-windows-process-tree-relay-addon.mjsconfig/scripts/ensure-native-runtime.mjsconfig/scripts/pr-code-change-scope.mjsconfig/scripts/rebuild-native-deps.mjsconfig/scripts/windows-process-tree-creation-time.cjsdocs/reference/windows-process-enumeration.mdsrc/main/claude/claude-structured-location-support.test.tssrc/main/windows/windows-process-table.test.tssrc/main/windows/windows-process-table.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/main/windows/windows-process-table.ts
- docs/reference/windows-process-enumeration.md
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Added a binary self-report for creation-time support — the patch now makes
addon.ccexportsupportedProcessDataFlags(MEMORY | COMMANDLINE | CREATIONTIME), re-exported throughlib/index.jsandlib/index.ts, andisWindowsProcessStartTimeAvailable()now reads that bit instead of the patched enum. This closes the hole the previous enum gate left open: pnpm patches the source tree over the tarball's prebuilt.node, so a host could holdCreationTime: 4in the enum while the binary silently ignored flag 4. - Wired an install-time guard that forces a source rebuild — the new
windows-process-tree-creation-time.cjsasserts the binary reports bit 4, and bothensure-native-runtime.mjs(Node check) andrebuild-native-deps.mjs(Electron probe) call it, so a stale prebuilt is rebuilt rather than trusted. - Extended the relay addon repair/verify to the new export —
build-windows-process-tree-relay-addon.mjsrepairs and assertssupportedProcessDataFlagsacrossaddon.cc, bothlib/index*files, and the typings, keeping the repair and the verification in lockstep. - Tightened the tests — the unit test now covers the enum-present-but-binary-stale shape (
supportedProcessDataFlags: 3), the no-export shape, and a relay "trust the addon's own report" case; the real-addon test keeps pinning both the gate and the bounded self-row.
The mechanism is sound on both deployment paths: on desktop the assert/rebuild flow guarantees the .node and the package's re-export agree, and on the relay the addon and reader are content-hashed into the same immutable bundle, so there is no cross-version window.
One informational note, not blocking: the PR description still cites the previous patch hash (c8de5dc3…) in its "sha256 is the patch_hash" verification claim, but the lockfile now records 76fc1512…. Worth updating so the self-verification claim stays accurate for reviewers.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — one follow-up commit since the last Pullfrog review.
- Kept the process-tree patch LF-only — stripped the 154 CR bytes that
pnpm patch-commitemitted for the CRLF-shipped source files (src/addon.cc,lib/index.js,lib/index.ts, the typings), restoring compliance with the main-branchwindows-process-tree-patch-contract.test.mjscontract while the pnpm patch hash stays76fc1512…(equal to the file's plain sha256). - Staged the native-runtime siblings in the test harness —
ensure-native-runtime.test.mjsnow copieswindows-process-tree-creation-time.cjsandwindows-process-tree-gyp-rebuild.mjsinto its temp project alongsidenode-pty-job-ownership.cjs, so the module-scope imports inensure-native-runtime.mjsresolve and the suite stops dying at import.
Verified the patch is byte-clean (0 CR bytes, sha256 matches the lockfile) and that the sibling list is complete against all three module-scope imports.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Status: green and validated on real Windows hardwareCI: run The review found three defects beyond the original oneThe PR started as a dependency patch. Reviewing it surfaced three more problems in the same family — each would have left the fix looking correct while it was broken:
Three of those four would have shipped a Windows build where the gate opens and structured chat is admitted, but the child-tree reaper can never prove an exit — degraded silently, not loudly. The guard caught the real one, in CI, on its first runThe gate assertion passed; the row assertion failed. That is precisely the patched-JS/stale-binary state, and an enum-only test would have gone green. The fix is visible in the current log: Parity sweep, driven through the running app on WindowsStructured routing to Three platform differences documented, none blocking: Windows spawns a Verification notes
Known-excluded, filed not bundled
For the Windows Codex laneOnce this lands, |
The relay addon build now emits creationTimeMs, but the runtime binding for the bare addon still declared only CommandLine, so a Windows relay host requested flag 2 and every row came back without a creation time. That leaves captureWindowsDescendantSnapshot returning null and verifyWindowsProcessIdentity false forever on those hosts -- the relay half of the patch was unreachable. Naming CreationTime in the adapter is safe because the bare addon is a content-hashed relay artifact: it ships in the same immutable relay directory as the bundle reading it, so it can never be older than the code asking for the bit. Also bound the win32 guard test on our own row, which the addon can never fail to answer, so an unconverted FILETIME or a 1601-epoch stamp fails instead of satisfying a bare count.
CI caught the real defect: the win32 guard test read
isWindowsProcessStartTimeAvailable() as true and then found 0 rows
carrying creationTimeMs. Unlike node-pty, this package publishes a
prebuilt .node at the same build/Release path node-gyp writes to, so
pnpm patches the source tree and leaves that binary alone. A host then
holds a patched lib/index.js -- ProcessDataFlag.CreationTime and all --
over a binary that ignores flag 4, and neither a load check nor a path
check can see the difference.
So the binary now says so itself: addon.cc exports
supportedProcessDataFlags, lib/index.js re-exports it, and
- windows-process-tree-creation-time.cjs asserts it during install,
which is what forces a from-source rebuild. It is shared by the Node
probe in ensure-native-runtime.mjs and the Electron probe in
rebuild-native-deps.mjs, exactly as node-pty-job-ownership.cjs is --
the Electron half matters because that probe decides onlyModules, so
without it the packaged app would ship the stale prebuilt.
- isWindowsProcessStartTimeAvailable() gates on the reported bit, not
the enum. Believing the enum is worse than reporting false: the
descendant snapshot returns null forever and the exit proof latches
unverifiable while structured chat believes it has a reaper.
rebuildNodeRuntimeModules could not actually have rebuilt this package:
the patched binding.gyp includes deps/node-addon-api, which the tarball
does not ship, and node-gyp must run from the physical dir.
Also closes the relay repair path's divergence: repairCreationTimeSources
wrote the C++ but not the buildNode splat or the tree-node typing, and
assertPatchApplied checked neither, so a repaired tree passed as patched
with buildProcessTree silently dropping the field.
The guard test is unchanged.
windows-process-tree-patch-contract.test.mjs requires the patch file to carry no CR bytes. Regenerating through pnpm patch-commit emitted 199 of them, because the creation-time change is the first to touch files the package ships as CRLF (src/process.h, src/process_worker.cc, src/addon.cc, lib/index.js, lib/index.ts, the typings) -- and #17886's own hunks over binding.gyp and src/process_commandline.cc carry the rest. Stripping them is safe and changes nothing the lockfile records: pnpm hashes patches CRLF-normalized, so the digest stays e66202cc623996d02040c93449eb9ae353fddadf426cb53202a59ee710ee6fe7 and now equals the file's plain sha256 too. It also still applies -- verified against a deleted store entry, not a warm one -- and the precedent was already there: the previous patch was LF-only and had been patching those same CRLF files all along. ensure-native-runtime.test.mjs stages the siblings the script loads at module scope into its temp project. The import walk added by #17886 sees `from './x.mjs'` only, so the createRequire'd .cjs siblings still have to be named, and this PR adds a second one.
cc0d94a to
72df82c
Compare
|
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. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 792b3d29-e102-48b7-bff5-af63f9a33dab
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (14)
.github/workflows/pr.ymlconfig/patches/@[email protected]config/scripts/build-windows-process-tree-relay-addon.mjsconfig/scripts/ensure-native-runtime.mjsconfig/scripts/ensure-native-runtime.test.mjsconfig/scripts/pr-code-change-scope.mjsconfig/scripts/rebuild-native-deps.mjsconfig/scripts/windows-process-tree-creation-time.cjsdocs/reference/windows-process-enumeration.mdsrc/main/claude/claude-structured-location-support.test.tssrc/main/windows/windows-process-table-native-addon.win32.test.tssrc/main/windows/windows-process-table.test.tssrc/main/windows/windows-process-table.tssrc/main/windows/windows-process-tree-command-line-patch.test.ts
🚧 Files skipped from review as they are similar to previous changes (11)
- .github/workflows/pr.yml
- config/scripts/rebuild-native-deps.mjs
- config/scripts/ensure-native-runtime.test.mjs
- config/scripts/ensure-native-runtime.mjs
- config/scripts/build-windows-process-tree-relay-addon.mjs
- config/scripts/windows-process-tree-creation-time.cjs
- src/main/windows/windows-process-table-native-addon.win32.test.ts
- config/scripts/pr-code-change-scope.mjs
- src/main/claude/claude-structured-location-support.test.ts
- src/main/windows/windows-process-table.test.ts
- docs/reference/windows-process-enumeration.md
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
| + if (CREATIONTIME & process_data_flags) { | ||
| + GetProcessCreationTime(pinfo); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
Keep ppid and creationTimeMs from one process instance.
Line 131 opens the PID after Toolhelp captured process_entry. If that process exits and Windows reuses its PID before this call, creationTimeMs belongs to the replacement process while ppid and name belong to the old process. Descendant cleanup can then classify an unrelated replacement process as a descendant.
Use one native snapshot that supplies parent PID and creation time together, such as SystemProcessInformation, before treating this tuple as PID-safe identity.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — one rebase + cleanup commit since the prior Pullfrog review.
- Regenerated the process-tree patch cleanly after a rebase. The branch was rebased onto
mainafter #17886 landed its command-line/EDR-posture work in the same.patchfile, which leftpnpm patch-commit's 199 CR bytes and literal merge-conflict markers (<<<<<<< HEAD/>>>>>>>) baked intoconfig/patches/@[email protected]. This commit strips all of it and resolves the merge correctly, so the patch now carries both the creation-time hunks and #17886's hunks in one coherent file. - Re-synced the lockfile patch hash from
f8ea2453…toe66202cc…, which equals the patch file's plain sha256. - Refactored the test-harness sibling staging into a named
REQUIRED_CJS_SIBLINGSlist (node-pty-job-ownership.cjs,windows-process-tree-creation-time.cjs) with an explanatory comment.
Verified the current patch is byte-clean and hash-synced: 0 CR bytes, no conflict markers, sha256 e66202cc… == the lockfile patch_hash, satisfying the main-branch windows-process-tree-patch-contract.test.mjs contract; and that the two createRequire'd CJS siblings (plus the walked ESM sibling) cover every module-scope import in ensure-native-runtime.mjs.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…ball Symptom: config/scripts/release-tarball-staged-config.test.mjs failed after the v1.4.200 rebase — "stages the whole import closure of the shipped postinstall" derived 8 scripts from source but POSTINSTALL_STAGED_SCRIPTS listed 7. Root cause: upstream 1478101 (stablyai#18986, new in v1.4.198-200) added config/scripts/windows-process-tree-creation-time.cjs and made it part of the shipped postinstall's dependency graph — rebuild-native-deps.mjs require()s it from the @vscode/windows-process-tree arm of the Electron load probe (line 626). The fork's S38 tarball builder hardcoded the staged list before that file existed, so the test's closure walker correctly picked up a file the constant did not name. Approach: add it to POSTINSTALL_STAGED_SCRIPTS next to the other require()d .cjs (node-pty-job-ownership.cjs) with a one-line note on why a require, not an import, reaches it. Without the entry the tarball would ship a postinstall that dies with a missing module the moment a host hits the windows-process-tree arm. Verified: release-tarball-staged-config.test.mjs 16/16 green; check:code-quality:changed clean. Co-Authored-By: Claude Opus 5 <[email protected]>
…tion time (stablyai#18986) * fix(windows): guard process creation times * fix(windows): ask the relay's bare addon for creation times too The relay addon build now emits creationTimeMs, but the runtime binding for the bare addon still declared only CommandLine, so a Windows relay host requested flag 2 and every row came back without a creation time. That leaves captureWindowsDescendantSnapshot returning null and verifyWindowsProcessIdentity false forever on those hosts -- the relay half of the patch was unreachable. Naming CreationTime in the adapter is safe because the bare addon is a content-hashed relay artifact: it ships in the same immutable relay directory as the bundle reading it, so it can never be older than the code asking for the bit. Also bound the win32 guard test on our own row, which the addon can never fail to answer, so an unconverted FILETIME or a 1601-epoch stamp fails instead of satisfying a bare count. * fix(windows): make the compiled addon prove its own CreationTime support CI caught the real defect: the win32 guard test read isWindowsProcessStartTimeAvailable() as true and then found 0 rows carrying creationTimeMs. Unlike node-pty, this package publishes a prebuilt .node at the same build/Release path node-gyp writes to, so pnpm patches the source tree and leaves that binary alone. A host then holds a patched lib/index.js -- ProcessDataFlag.CreationTime and all -- over a binary that ignores flag 4, and neither a load check nor a path check can see the difference. So the binary now says so itself: addon.cc exports supportedProcessDataFlags, lib/index.js re-exports it, and - windows-process-tree-creation-time.cjs asserts it during install, which is what forces a from-source rebuild. It is shared by the Node probe in ensure-native-runtime.mjs and the Electron probe in rebuild-native-deps.mjs, exactly as node-pty-job-ownership.cjs is -- the Electron half matters because that probe decides onlyModules, so without it the packaged app would ship the stale prebuilt. - isWindowsProcessStartTimeAvailable() gates on the reported bit, not the enum. Believing the enum is worse than reporting false: the descendant snapshot returns null forever and the exit proof latches unverifiable while structured chat believes it has a reaper. rebuildNodeRuntimeModules could not actually have rebuilt this package: the patched binding.gyp includes deps/node-addon-api, which the tarball does not ship, and node-gyp must run from the physical dir. Also closes the relay repair path's divergence: repairCreationTimeSources wrote the C++ but not the buildNode splat or the tree-node typing, and assertPatchApplied checked neither, so a repaired tree passed as patched with buildProcessTree silently dropping the field. The guard test is unchanged. * fix(windows): keep the process-tree patch LF-only windows-process-tree-patch-contract.test.mjs requires the patch file to carry no CR bytes. Regenerating through pnpm patch-commit emitted 199 of them, because the creation-time change is the first to touch files the package ships as CRLF (src/process.h, src/process_worker.cc, src/addon.cc, lib/index.js, lib/index.ts, the typings) -- and stablyai#17886's own hunks over binding.gyp and src/process_commandline.cc carry the rest. Stripping them is safe and changes nothing the lockfile records: pnpm hashes patches CRLF-normalized, so the digest stays e66202cc623996d02040c93449eb9ae353fddadf426cb53202a59ee710ee6fe7 and now equals the file's plain sha256 too. It also still applies -- verified against a deleted store entry, not a warm one -- and the precedent was already there: the previous patch was LF-only and had been patching those same CRLF files all along. ensure-native-runtime.test.mjs stages the siblings the script loads at module scope into its temp project. The import walk added by stablyai#17886 sees `from './x.mjs'` only, so the createRequire'd .cjs siblings still have to be named, and this PR adds a second one. --------- Co-authored-by: Merge Sim <sim@local>

What this fixes
Structured Claude native chat is unavailable on Windows, and nothing in the Claude code path is at fault.
supportsClaudeStructuredLocationreduces on win32 toisWindowsProcessStartTimeAvailable(), which needs a process creation time from@vscode/windows-process-tree. Our pinned patch never added that field, so the gate failed closed and every structured session on Windows silently fell back to the legacy terminal path.Fixing that surfaced three further defects in the same family, each of which would have made the fix look correct while leaving it broken.
The change
The dependency. The patch gains
CreationTime(flag 4) —GetProcessCreationTimeopensPROCESS_QUERY_LIMITED_INFORMATIONand convertsGetProcessTimes' FILETIME to Unix ms. A process that denies the handle is emitted with the field absent, never zero, so callers can distinguish "cannot identify" from a timestamp.The binary describes itself. The patch also exports
supportedProcessDataFlagsfromsrc/addon.cc. This package publishes its prebuilt at the exact path node-gyp writes to, and the field is only discoverable through an async call — so there was no synchronous way to tell a patched binary from a stock one.isWindowsProcessStartTimeAvailable()now reads that export rather than the JS enum.The build actually rebuilds it.
ensure-native-runtime.mjsproved nothing butrequire(), which succeeds against upstream's prebuilt, so the patched C++ was never compiled in the node-runtime lane. A sharedconfig/scripts/windows-process-tree-creation-time.cjsnow asserts the capability and routes into the existing failure→rebuild path, mirroringnode-pty-job-ownership.cjs.rebuildNodeRuntimeModulesalso could not have rebuilt this package even when asked — the patchedbinding.gypincludesdeps/node-addon-api, which the tarball does not ship — so headers are staged and the realpath resolved first.The relay path asked for nothing.
PROCESS_DATA_FLAGomittedCreationTime, soflags = CommandLine | (CreationTime ?? 0)resolved to2. A relay host would compile the addon with support and never request it, leavingverifyWindowsProcessIdentitypermanently false andterminateIdentifiedWindowsProcessTreeunable to kill.A guard that runs on the platform it guards.
windows-process-table.test.tspins the predicate through an injected fake loader, so it can never observe the real addon. The new*.win32.test.tsuses the existingit.runIf(process.platform === 'win32')idiom and asserts the gate opens, that rows carrycreationTimeMs, and that our own row's value is between 2020 and now — an unconverted 100ns tick lands astronomically high, a 1601 epoch below the floor.Measured on real Windows hardware
Two-point ablation, same box and worktree, only the patch differing:
ProcessDataFlagisWindowsProcessStartTimeAvailable()creationTimeMsBoth binaries differ in size and mtime, ruling out the case where patched JS opens the gate while a stale
.nodereturns nothing.CI proved that case is not hypothetical. The guard's first run failed with
expected 0 to be greater than 0while the gate assertion passed — exactly the stale-binary state, caused by the rebuild gap above. An enum-only assertion would have gone green.Parity sweep on Windows
Structured chat driven end to end in a running app: routing to
agent-session, multi-turn state carried across turns, a real tool call reading a repo file, interrupt leaving the composer usable, transcript surviving tab switches, and teardown leaving no orphaned descendants (claudeand itsconhostchild both reaped, no reparented stream-json processes).Three platform differences worth knowing, none blocking: Windows spawns a
conhost.exechild per agent that orphan logic must expect; the capability gate has no macOS/Linux analogue; tool-call paths render with native backslashes.Note for the Windows Codex lane
Once this lands,
supportsCodexStructuredLocationalso answerssupported: trueon Windows. Codex still routes to legacy because of the client-side term insrc/renderer/src/lib/agent-launch-routing.ts, which is that lane's to lift. Measured: host gate true, routing stilllegacy-native-chat. No Codex behaviour changes here.Deliberately excluded
CLAUDE_SECURESTORAGE_CONFIG_DIRis absent fromCLAUDE_AUTH_ENV_VARS, so an inherited value overrides the pinned account home for credential lookup; nothing normalizes config-dir path separators;refreshLocalRuntimeCapabilities()is async and an agent launched before it settles sees empty capabilities and silently routes legacy; the.gitattributescomment onconfig/patches/*.patchdescribes pnpm as hashing "byte-for-byte" when it normalizes line endings first. All real, none required here, all filed rather than bundled.