Repository navigation
feat(windows): enable structured Codex chat on native Windows - #18519
Conversation
# Conflicts: # src/main/runtime/orca-runtime.ts
…outer #18248 deleted canUseStructuredNativeChat and replaced it with resolveAgentLaunchRoute, which still carried a blanket `platform !== 'win32'` refusal -- the exact refusal this lane removes. Taking main's deletion would have gone green on tc and lint while silently dropping the whole Windows enablement, so the gate is ported rather than merged. - resolveAgentLaunchRoute now takes a REQUIRED tri-state windowsProcessStartTime ('available' | 'unavailable' | 'unknown') and a required worktreeUsesWslPath. Required, not optional, so the compiler enumerates every call site -- it immediately found a 7th behind a forwarding wrapper that a grep of the call sites had missed. - 'unknown' is refused: a host that never answered the probe must not have a PID adopted against it. - Derivation lives once in agent-launch-routing-windows-gate.ts. hasCachedWindowsTerminalCapabilities distinguishes unprobed from probed-false. - resolveStructuredAgentSessionLocation: both WSL branches now key on executionHostId. main's resolveRuntimeFileTarget no longer returns connectionId at all, so the folder branch's `!target.connectionId` was permanently true; the file is @ts-nocheck so nothing caught it. - create-intent stubs updated to main's target contract. - readWorktreeUsesWslPath defaults both store collections: an unhydrated store must read as "not WSL", not throw on the launch path. Gates: pnpm tc 0. Gate tests ablation-proven in BOTH directions -- reverting to the blanket refusal reddens the 2 enablement tests; forcing allow reddens the 4 refusal tests. ssh-multi-factor-authentication failures reproduce on pure origin/main and are not attributable to this merge.
Review found pathUsesWslUnc exported but unused, and the folder composer hardcoding worktreeUsesWslPath:false. Together those meant a folder picked under a \\wsl.localhost\ parent routed to structured chat, then got refused by the host and fell back AFTER the click -- which defeats the lane's own design goal that create cannot fail after the click. The group's parentPath is in scope at submit and the workspace is created under it, so the parent decides WSL-ness pre-click. Wires pathUsesWslUnc there and adds tests for the helper, including the unhydrated-store case that previously threw.
|
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:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe change adds Windows process creation-time support to the native process table and validates it with an end-to-end capability probe. Runtime status now reports this capability asynchronously. Structured Windows launches require proven creation-time support and reject WSL worktree paths. Session acquisition and handoff paths recheck provider support before spawning. Codex process spawning now uses shared child-process abstractions. Renderer routing and capability refresh logic consume the new status field. Merge Risk: 🟡 Moderate · up to Windows structured sessions now require process-identity proof and reject WSL locations, but creating a new folder may still choose the structured path for a WSL UNC workspace before that refusal is applied. This can produce an unsupported launch flow for affected Windows users and should be resolved before merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description gives detailed context, implementation scope, rationale, testing results, known defects, and follow-ups. However, it omits the required Linked Issue section and does not provide the required Visual Proof section or before-and-after evidence for this behavior change. The template checklist is also not completed explicitly. Resolution Add a Linked Issue entry with the required issue reference. Add the Visual Proof section with before-and-after screenshots or a video; use N/A only if the change has no visual or interaction impact. Complete the applicable Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. ✨ 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: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: ba8d94d6-cce7-4b5d-8df0-6a6d1d72a790
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (57)
config/patches/@[email protected]config/scripts/build-windows-process-tree-relay-addon.mjsdocs/reference/windows-process-enumeration.mdsrc/main/codex/codex-app-server-client.tssrc/main/codex/codex-app-server-session.tssrc/main/codex/codex-structured-launch-resolution.test.tssrc/main/codex/codex-structured-launch-resolution.tssrc/main/codex/codex-structured-location-support.test.tssrc/main/codex/codex-structured-location-support.tssrc/main/codex/codex-structured-session-adapter.tssrc/main/codex/codex-structured-session-state.tssrc/main/ipc/runtime.test.tssrc/main/ipc/runtime.tssrc/main/native-chat/agent-session-wire/structured-agent-session-acquisition.tssrc/main/native-chat/agent-session-wire/structured-agent-session-attach-flow.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host-handoff.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host-handoff.tssrc/main/native-chat/agent-session-wire/structured-agent-session-processless-reservation.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-provider-support.tssrc/main/native-chat/agent-session-wire/structured-agent-session-recovery-exits.test.tssrc/main/runtime/orca-runtime-get-status.tssrc/main/runtime/orca-runtime-resolve-recovered-structured-tui-transcript.tssrc/main/runtime/orca-runtime-status-windows-process-start-time.test.tssrc/main/runtime/orca-runtime-structured-agent-session-create-intent.test.tssrc/main/runtime/remote-runtime-request-connection.integration.test.tssrc/main/runtime/rpc/methods/status.tssrc/main/runtime/rpc/methods/updater.test.tssrc/main/runtime/runtime-rpc-mobile-terminal-streaming.test.tssrc/main/runtime/structured-agent-session-integration-replay.test.tssrc/main/runtime/structured-agent-session-integration.test.tssrc/main/runtime/structured-agent-session-runtime-exit.test.tssrc/main/runtime/structured-agent-session-runtime.test.tssrc/main/runtime/structured-agent-session-runtime.tssrc/main/windows/windows-process-table.test.tssrc/main/windows/windows-process-table.tssrc/renderer/src/components/settings/ExperimentalPane.test.tsxsrc/renderer/src/components/settings/NativeChatExperimentalSetting.tsxsrc/renderer/src/components/sidebar/folder-workspace-composer-submit.tssrc/renderer/src/hooks/composer-state/full-creation-execution.tssrc/renderer/src/hooks/composer-state/quick-creation-execution.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/agent-launch-routing-windows-gate.tssrc/renderer/src/lib/agent-launch-routing.test.tssrc/renderer/src/lib/agent-launch-routing.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-work-item-direct-route-preparation.tssrc/renderer/src/lib/onboarding-folder-agent-startup.tssrc/renderer/src/lib/windows-terminal-capabilities-race.test.tssrc/renderer/src/lib/windows-terminal-capabilities.test.tssrc/renderer/src/lib/windows-terminal-capabilities.tssrc/renderer/src/lib/windows-terminal-capability-read.tssrc/renderer/src/lib/windows-terminal-capability-reprobe.test.tssrc/renderer/src/lib/windows-terminal-capability-reprobe.tssrc/shared/child-process/__fixtures__/child-process-import-allowlist.txtsrc/shared/child-process/child-process-import-boundary.test.tssrc/shared/runtime-session-contracts.tstests/e2e/ssh-docker-transport-drop-recovery.spec.ts
💤 Files with no reviewable changes (1)
- src/shared/child-process/fixtures/child-process-import-allowlist.txt
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
| // The workspace has no store entry until after this decision, so the | ||
| // WSL-UNC check cannot run yet; it applies on the next launch. | ||
| worktreeUsesWslPath: false, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Classify the pending workspace path before route selection.
On Windows, worktreeUsesWslPath: false allows resolveAgentLaunchRoute to return structured-native-chat. Both flows pass this value before workspace creation, then enter the structured launch path. Use pathUsesWslUnc with the pending folder path at both call sites.
src/renderer/src/hooks/composer-state/full-creation-execution.ts#L147-L149src/renderer/src/hooks/composer-state/quick-creation-execution.ts#L213-L215
There was a problem hiding this comment.
ℹ️ No critical issues — one minor observation inline.
Reviewed changes
This PR removes the blanket platform !== 'win32' refusal that kept structured Codex chat off native Windows, replacing it with a measured capability gate: the host must prove — by reading its own PID's creationTimeMs from the patched @vscode/windows-process-tree addon — that the process table exposes creation times, before any PID is adopted for ownership. Ownership is refused (unknown/unavailable) at every layer, and the two new required router fields make the compiler enumerate call sites.
- Native addon + build: a hunk on
@vscode/[email protected]addscreationTimeMsunder aCreationTime = 4flag (GetProcessTimes/PROCESS_QUERY_LIMITED_INFORMATION), with the relay build asserting the patch landed and repairing a CRLF pnpm materialization. - Main-process gate:
windows-process-table.tsgainsprobeWindowsProcessStartTimeAvailability()(single-flight, 30s rate-limit) and a fail-closedisWindowsProcessStartTimeAvailable();getStatus()dropsSTRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITYon win32 without proof andstatus.get/runtime:getStatusawait the probe. - Ownership re-check:
performAttachandacquireNativeHandoffOwnerre-checkadapterSupportsCreateIfDeclaredbefore and after reservation/drain, settling a drifted reservationprocessless. - Renderer router:
resolveAgentLaunchRouteadds requiredwindowsProcessStartTimeandworktreeUsesWslPathfields; six call sites pass them. - WSL bug fix:
resolveStructuredAgentSessionLocationkeys onexecutionHostIdinstead of the always-true!target.connectionId, and derives folder-workspace WSL distros viaparseWslUncPath. - Spawn migration: Codex app-server sessions move from
node:child_process.spawntospawnProcess(child-process import pin 158 → 157).
The gate tests abort in both directions, the capability reader validates the enum against real own-PID evidence rather than trusting patched JS, and the process-identity proof is fully fail-closed end to end.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…-lines CI static analysis failed: launch-agent-in-new-tab.ts crossed the 300-line oxlint ceiling. Adding a max-lines disable is forbidden, so the two gate derivations collapse into one readWindowsStructuredGateInputs() call -- a store-backed site now adds one line and one import name instead of two. Better shape anyway: one derivation entry point rather than two reads a call site must remember to pair.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (since the prior review at e68efb2)
New commit 0428f8a ("decide folder-workspace WSL routing before the click") addresses the one minor finding from the prior review — the unused pathUsesWslUnc helper.
- First-launch WSL folder routing:
folder-workspace-composer-submit.tsnow derivesworktreeUsesWslPathfrompathUsesWslUnc(projectGroup.parentPath)instead of hard-codingfalse, so a folder workspace created under a WSL parent is classified correctly before the click rather than making a doomed structured attempt and falling back. pathUsesWslUncwired in: the previously-dead export is now used (and itsisWslUncPathdependency handles both\\wsl.localhost\and legacy\\wsl$\spellings).- New tests:
agent-launch-routing-windows-gate.test.tscoverspathUsesWslUnc(both UNC spellings, native, absent path) andreadWorktreeUsesWslPath(unhydrated store does not throw; WSL folder workspace is detected).
The parentPath signal is correct — createFolderWorkspace materializes the new workspace under the project group's parent, so a WSL parent reliably implies a WSL child. The three remaining creation flows still defer to "next launch" with worktreeUsesWslPath: false, but those are git-worktree/onboarding paths that remain fail-closed through the main-process supportsCodexStructuredLocation refusal.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (since the prior review at 0428f8a)
New commit 2aaf7c7c ("collapse the gate derivation to one call, restoring max-lines") is a pure refactor with no behavioral change.
- Combined gate helper:
readWindowsStructuredGateInputs(state, worktreeId)returns bothwindowsProcessStartTimeandworktreeUsesWslPathin one object, so store-backed call sites spread it instead of calling two functions. - Call sites:
launch-agent-in-new-tab.tsandlaunch-work-item-direct-route-preparation.tsnow use...readWindowsStructuredGateInputs(...), which preserves the exact same values each field derived before (readWindowsProcessStartTimeGate()defaults to ownerlocal;readWorktreeUsesWslPathstill defaults unhydrated collections to "not WSL").
The spread is type-correct against the two now-required router fields, and the values are unchanged — this is a max-lines cleanup, not a semantics change.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Review found a P1 this merge composes: neither parent could reach it. At the
lane head the only structured entry was launch-agent-in-new-tab (full
store-backed WSL check); on main all win32 was refused. The merge enables
win32 in creation flows that pass no projectRuntime, so a WSL folder
workspace, a WSL-configured repo, or a repair-required runtime now routes
structured -- and the host refuses correctly, but by THROWING rather than
returning {ok:false, refusal}.
Callers engage their legacy-terminal fallback on the refusal CLASS, so an
unmapped throw arrives as a generic RPC rejection: no fallback, empty
workspace, error toast, prompt stranded in the launch outbox. Pre-merge the
same action opened a legacy terminal agent.
Map the host's thrown definitive refusals onto the refusal class at the
launch boundary, so every creation flow -- present and future -- degrades to
the legacy terminal instead of stranding. Narrow predicate: unrelated
failures (ECONNRESET, empty message, non-Error) still propagate untouched.
Ablation-proven: removing the mapping reddens the fallback test.
…dded CI's first-ever run on this lane caught a pre-existing lane defect. The lane changed status.get to resolve through runtime.getStatusAfterWindowsProcessStartTimeProbe(), but never taught the mobile-surface runtime double about it, so status.get failed for mobile clients with "not a function". The lane's own test list did not include this file and the lane had zero CI, so nothing ever ran it. The real runtime always implements the method; the double omitted it.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (delta against the prior Pullfrog review at 2aaf7c7c)
- Thrown-refusal mapping —
launchStructuredCodexSessionnow wrapscallStructuredAgentSessionand maps the host's thrown definitive refusals — thestructured_agent_session_unsupportedsentinel and theProject runtime requires repair …phrase — ontoStructuredAgentSessionCreateRefusalError, so every creation flow (present and future) degrades to its legacy-terminal fallback instead of stranding the prompt in the launch outbox. - Narrow-predicate guard —
isThrownStructuredRefusalmatches only those two markers against anErrormessage; unrelated failures (ECONNRESET, empty messages, non-Errorvalues) still propagate untouched. - Mobile RPC double —
createMobileRpcSurfaceRuntimenow stubsgetStatusAfterWindowsProcessStartTimeProbe, the methodstatus.getresolves through, fixing the "not a function" latent in the mobile surface.
Both markers trace cleanly to their host throw sites (resolveStructuredAgentSessionIntent/the structured gate for the sentinel; getLocalProjectWorktreeGitOptions for the repair phrase), and RuntimeRpcCallError extends Error preserves the message across the local transport, so the predicate sees the real text. The new test is ablation-proven and the transport prefix is covered.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…alog CI static analysis failed on a stale en-runtime-required.json: main added onboarding integration-capability keys, and the generated catalog is checked against the PR MERGE result, not the branch alone -- so it read clean locally while failing in CI. Merging current main (90780ac) and regenerating. Gates after the merge: pnpm tc 0, oxlint 0, changed-code quality 0/56, 7 gate/lane test files 69 tests green.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (delta against the prior review at 42702a680)
New commit 47abbd3 ("route structured launches by execution host platform") replaces the client's navigator.userAgent-derived platform with the runtime's authoritative host platform.
- Execution-host platform —
resolveAgentLaunchRoutenow takes a requiredexecutionHostPlatform: NodeJS.Platform | nullinstead ofplatform.windowsStructuredAllowedrefusesnull(fail-closed) and applies the Windows proof gate to the host's platform, so a browser on one OS can no longer route a session backed by a Windows host without the start-time proof. - Host platform read —
local-runtime-capabilities.tsgainsreadLocalRuntimeHostPlatform(), populated fromstatus.hostPlatformalongside capabilities and cleared on error.readAgentLaunchHostPlatformfalls back toclientPlatformon native desktop and tonull(fail-closed) on paired web until the host answers. - Boundary consolidation — the two gate helpers (
readWindowsCreationGateInputs,readWindowsStructuredGateInputs) now return{ executionHostPlatform, windowsProcessStartTime, worktreeUsesWslPath }, and a caller-census test pins every call site to them.
The host-platform, capability, and start-time signals are all fed by the same refreshLocalRuntimeCapabilities() status read, so the new null/unknown fail-closed paths align with the pre-existing capability gate rather than adding a new failure mode.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (delta against the prior review at 47abbd3)
New commit 81bfca0 ("recover paired structured session mirror on host swap") closes the gap the 47abbd3 execution-host routing left open: on a paired web client, the local structured-session mirror subscribed through window.api.runtime.subscribe, which never delivers a close notification when the host is swapped, so stale tabs and the previous host's status/capabilities could bleed across the pairing boundary.
- Host-aware subscription — on web,
subscribeCurrentnow routes throughwindow.api.runtimeEnvironments.subscribe({ selector: 'active', ... }, { onResponse, onClose: handleSubscriptionTermination })instead ofruntime.subscribe, so an environment swap that closes the child subscription without an RPCendframe still reconnects. - Effect restart on host swap —
useLocalStructuredSessionTabsSyncaddswebEnvironmentId(the active environment id, null on native) to its dependency array, so a host swap tears down the mirror and starts it fresh against the new host. - Callback refactor — the inline response handler is extracted into
onResponse; the shared generation-fencedhandleSubscriptionTerminationnow drives both error/endtermination and transportonClose. - Tests — a new case drives
onCloseand asserts the backoff reconnect plus a freshgetStatuscapability refresh; the web subscription double (which accepts an{ onResponse, onClose }object) is exercised.
The two recovery paths (transport onClose retry and the webEnvironmentId effect restart) are fenced by the existing isCurrent()/disposal generation, so the redundant onClose retry no-ops once the effect has disposed the old sync.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
This reverts commit 47abbd3.
Reverts the two review-loop commits (restoring a tree byte-identical to the validated head) and closes the hole they were aiming at, without their cost. A paired web client's `platform` describes the browser's machine, not the host that will run the agent, so the Windows gate cannot be evaluated there. Before this, a browser on macOS driving a Windows runtime read "not win32", skipped the creation-time proof entirely and allowed structured chat — fail-OPEN, the dangerous direction, bypassing the guarantee this lane is built on. `isWebClient` is a required input like the other gate fields, so the compiler enumerated all seven call sites. Refusal is synchronous and fail-closed: no async round-trip, no null window, no cache to invalidate — unlike keying on an asynchronously-fetched host platform, which would have made every desktop launch wait on a round-trip to fix a paired-web-only hole. Paired web therefore gets the legacy chat until the host publishes eligibility itself; that is the proper fix and belongs in its own PR. Ablation-proven: removing the guard reddens both refusal tests; the desktop-unaffected test is a preservation check and passes either way. Gates: tc 0, oxlint 0. Known open: repos-onboarding-folder-startup.test.ts fails on this branch and passes on plain main — under investigation, NOT caused by this commit.
The web-client refusal added `isWebClientLocation()` to the launch-route
inputs, which this suite's store path reaches while adding the FIRST folder.
The suite stubs `window` as `{ api }` with no `location`, so the function
cleared its `typeof window === 'undefined'` guard and then threw on
`window.location.pathname`.
That threw inside addNonGitFolder's own catch, so folder-1 never activated;
folder-2 then returned early (a project already existed) before reaching the
call at all, leaving exactly one activation with no startup seed.
Test artifact, not a product defect: a real renderer always has
`window.location`, so the seeding path is intact for users. Mocking the module
is the convention 7 other suites already use, and keeps product code free of
defensive branches that only exist to satisfy a stub.
Ablation-proven: removing the mock reproduces the original failure exactly.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (delta against the prior Pullfrog review at 81bfca0)
The two review commits from the prior round were reverted and replaced with a fully synchronous, fail-closed refusal.
- Reverted execution-host-platform routing —
d54189408freverts47abbd3, dropping the requiredexecutionHostPlatformrouter field plusreadLocalRuntimeHostPlatform,readAgentLaunchHostPlatform, andreadWindowsCreationGateInputs.windowsStructuredAllowedkeys on the clientplatformagain, restoring the synchronous launch path for every desktop user. - Reverted paired-web host-swap recovery —
58f963180areverts81bfca0, solocal-structured-session-tabs-syncno longer subscribes viaruntimeEnvironmentsor restarts onwebEnvironmentId; the revert leaves no dangling references and is now moot because web is refused structured chat outright. - Added a required
isWebClientfail-closed refusal —resolveAgentLaunchRoutegains a requiredisWebClientfield andstructuredSupportednow requires!input.isWebClient. A paired web client'splatformdescribes the browser's machine, not the host that will run the agent, so the gate refuses rather than guessing — legacy terminal until the host publishes eligibility itself. - Creation flows pass the gate halves directly — the six call sites spread
windowsProcessStartTime: readWindowsProcessStartTimeGate()+isWebClient: isWebClientLocation()(+worktreeUsesWslPath); the required fields let the compiler enumerate call sites, and the caller-census test was trimmed to pin route owners only. - Reprobe settles only after proof —
isSettlednow requires awin32host with usable WSL to provewindowsProcessStartTimeAvailable === truebefore ceasing re-checks, andcapabilitySignatureincludes the flag so a proof change resets backoff.
The refusal is synchronous and fail-closed end to end, the reverted commits' async host-platform state is fully removed, and the paired-web hole is closed by refusing rather than by guessing the browser's OS.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Windows validation — evidenceCaptured on real hardware (Windows 11, Capability was proven on the machine before testing, not assumed: the patched process-tree addon returns Structured chat works on native WindowsStructured session launches — a structured native-chat session, not a legacy terminal pane. A reply streams back — Reload reconnects live — not merely transcript retention. After reloading the renderer, a new message returned It is not worse for users who never enable the flagSetting persists off Legacy path is fully live — with the experiment off, Codex opened a terminal-backed chat with a non-null An earlier run failed this check, but that run's dev app had not inherited Codex credentials — every turn died on a missing API key. Re-run with credentials present, it passes. Worth stating plainly since the first result looked like a regression and was not one. Open defect — not fixed by this PRRapid successive messages duplicate one prompt and drop another. Three prompts sent back-to-back settled as This PR only decides routing and does not touch message dispatch, so this is most likely a pre-existing structured-chat defect now reachable on Windows for the first time. It is unattributed — confirming it on macOS would settle whether it is platform-specific, and it should be filed separately either way. Also covered, no screenshot needed
Scope of this evidenceThis is a dev build, not a packaged one. CI's |
isWebClientLocation() guarded `typeof window === 'undefined'` and then assumed `window.location` existed. A window stubbed without a location cleared the guard and threw on `.pathname`. That matters because this branch put the call on the launch-routing path, where the throw is swallowed by the caller's catch and silently becomes a FAILED LAUNCH rather than a visible error. CI caught it as 9 failures in launch-work-item-direct.test.ts. I previously "fixed" this by mocking the module in the one suite I knew about. That was whack-a-mole against an unbounded set, and it missed this one. The defect is the partial-window assumption, so fix it there: the mock is removed from the onboarding suite and both suites now pass on the hardening alone. Ablation-proven: reverting to the unguarded form reddens 11 tests across the new unit suite and launch-work-item-direct. Gates: tc 0, oxlint 0, changed-code quality 0/58.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (delta against the prior Pullfrog review at c9a9186)
The single new commit 64b2bd7 ("make the web-client check total over a partial window") hardens the paired-web-client gate and drops the test mock that previously papered over its fragility.
- Total over a partial
window—isWebClientLocation()now readswindow.locationwith optional chaining (location?.pathname) and gates the.endsWith('/web-index.html')check behindtypeof pathname === 'string', so awindowstub lacking a usablelocationreturnsfalseinstead of throwing. This matters because the check runs on the launch-routing path, where a throw is swallowed and silently becomes a failed launch. - Dedicated test file —
web-client-location.test.tscovers all six branches: nowindow,windowwithoutlocation,locationwithoutpathname, the/web-index.htmlentry path, the__ORCA_WEB_CLIENT__global marker, and the normal desktop/index.htmlpath. - Onboarding mock removed — the now-unnecessary
vi.mock('../../lib/web-client-location', …)was deleted fromrepos-onboarding-folder-startup.test.ts; the store path now calls the real, total function, which answersfalseagainst the test'slocation-less window stub.
The guard is behavior-preserving for real renderers (a genuine window.location.pathname is always a string) and only changes what happens under a partial stub, so the net effect is strictly a robustness improvement. isWebClientLocation is re-exported and consumed in ~30 renderer sites, all of which benefit from it no longer throwing.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
INTERMEDIATE STATE - typecheck is red by design; stage 2 reconnects the seams. Main rewrote this lane's subsystem (a65332a moved structured chat onto the Claude Agent SDK and made the launch layer agent-generic). Every conflict is resolved TOWARD main so the merge is coherent, which means codex stays refused on win32 for now - main's behaviour. That is deliberate: enabling codex before the host probe is wired would leave a window with no gate at all. Dropped `launch-structured-codex-session.ts` and its test. Main deleted that module; our refusal->fallback mapping lived in it, and in the merged tree every production caller already resolved to main's replacement - the only remaining importer was our own test. The feature was dead code with green tests. Main's replacement is also strictly better: it classifies by WIRE CODE via isDefinitiveAgentSessionCreateRefusal and adds a separate StructuredAgentSessionCreateUnknownOutcomeError, so an unproven create is not treated as a definitive refusal. Ours matched error-message substrings and would have called every matched throw definitive - abandoning a session that may exist. Reference implementations agree: allowlist exact codes, treat timeouts and disconnects as ambiguous, never act destructively on an unproven refusal. The @ts-nocheck conflict was imports-only; resolved as a union and each of the four symbols verified used by hand, since the compiler cannot check that file. Remaining red, all ours to reconnect in stage 2: - isWindowsProcessStartTimeAvailable no longer on StructuredAgentSessionRuntimeDeps - host-handoff test predates main's HostHandoffAccess.findSession + journal API
…Support probe The renderer no longer decides Codex win32 eligibility: launchStructuredAgentSession probes agentSession.createSupport for both providers, the host answers via supportsCodexStructuredLocation (process start-time proof + WSL refusal), and the create path re-checks live. Deletes the client-side windows gate module and its routing inputs (windowsProcessStartTime, worktreeUsesWslPath, isWebClient, platform) from six call sites. Splits killCodexAppServerProcessTree out of codex-app-server-session to hold the max-lines ceiling without a disable.
There was a problem hiding this comment.
Important
Removing the isWebClient refusal silently re-opens the paired-web host-swap gap that 81bfca0 fixed and 58f963180a reverted. The revert's justification ("moot because web is refused structured chat") no longer holds.
Reviewed changes
This delta re-architects the Windows gate out of the renderer: it deletes the client-side refusal module and the required windowsProcessStartTime / worktreeUsesWslPath / isWebClient router fields, and makes launchStructuredAgentSession ask the executing host agentSession.createSupport for both Codex and Claude before create.
- Renderer gate deleted —
agent-launch-routing-windows-gate.tsandlaunch-structured-codex-session.tsare removed;resolveAgentLaunchRoutekeeps onlyisAgentSessionHandleProvider+executionHostId === 'local'+ the runtime capability, so Codex on Windows is no longer refused client-side. - Host-side create-support probe for both providers —
launchStructuredAgentSessionnow callsagentSession.createSupportbeforecreatefor Codex and Claude; the host answers fromisWindowsProcessStartTimeAvailable()viasupportsCodexStructuredLocation/supportsClaudeStructuredLocation. Thrown host refusals are mapped by code (structured_agent_session_unsupported/method_not_found) rather than message substring. - Codex app-server kill extracted + gated —
killCodexAppServerProcessTreemoves tocodex-app-server-process-tree-kill.tsand gates its win32taskkill /t /ftree-walk behindadmitProcessTreeKill(falling back to a handle-addressedSIGKILLon refusal). structuredScopecopy updated to describe the host-advertised-support model.
The host is now the single authority for Windows eligibility and answers the question the client used to guess, so a browser on any OS can no longer route a Windows-hosted session past the proof. The renderer capability gate (STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY dropped on win32 without proof in orca-runtime-get-status.ts) still fails closed, so the first line of defense is unchanged.
⚠️ Paired-web host-swap recovery is gone, and its justification just went away
Commit 58f963180a reverted the paired-web host-swap recovery (81bfca0) on the explicit ground that the isWebClient refusal made the gap moot — a paired web client could never reach structured chat, so a stale tab mirror did not matter. This delta deletes that refusal. Structured chat is now reachable on a paired web client whenever the host answers the createSupport probe, but the recovery is still absent: useLocalStructuredSessionTabsSync has deps [enabled, ready] (no environment id), and subscription.ts subscribes via window.api.runtime.subscribe with no onClose wiring. On a host swap the renderer never learns the old subscription died, clearLocalStructuredSessionTabs() is only called on feature toggle-off, and the inventory is not environment-scoped — so tabs from the previous host can survive the swap and the new host's sessions never mirror.
The forward fix is already in this branch's history: 81bfca0 subscribed via runtimeEnvironments.subscribe({ selector: 'active', … }, { onResponse, onClose }) and restarted the effect on a webEnvironmentId dep. Either restore that, or confirm (and document) that paired web cannot reach the structured mirror through the creation flows — note launch-agent-in-new-tab.ts already diverts web hosts to launchAgentInWebHostTab before routing, so the tab-bar path is covered; the composer/creation flows that call startStructuredAgentLaunch directly are the open question.
Technical details
# Paired-web host-swap gap re-opened
## Affected sites
- src/renderer/src/lib/agent-launch-routing.ts:94-107 — `isWebClient` refusal removed; `structuredSupported` no longer refuses paired web.
- src/renderer/src/runtime/local-structured-session-tabs-sync.ts:26-46 — `useEffect` deps are `[enabled, ready]`, no environment id; `clearLocalStructuredSessionTabs()` only on toggle-off.
- src/renderer/src/runtime/local-structured-session-tabs-sync/subscription.ts:62-109 — `subscribeCurrent` uses `window.api.runtime.subscribe` with no `onClose`/`onError`.
- src/renderer/src/runtime/local-structured-session-tabs-sync/snapshot-apply.ts — inventory keyed by worktree + version fences, not environment.
## Required outcome
- On a paired web client, a host swap tears down the old host's structured-session tab mirror and re-establishes it against the new host (or paired web is provably never routed into the structured mirror, with the routing invariant stated in code/comments).
## Suggested approach
- Restore the `81bfca0` shape: branch on `isWebClientLocation()` in `subscription.ts` to subscribe via `runtimeEnvironments.subscribe` with `onClose`, and add `webEnvironmentId` (`state.runtimeEnvironments[0]?.id`) to the effect deps with `clearLocalStructuredSessionTabs()` on cleanup.
## Open questions for the human
- Do the composer/creation flows (`folder-workspace-composer-submit`, `full/quick-creation-execution`, `onboarding-folder-agent-startup`) reach `startStructuredAgentLaunch` on a paired web client, or does their `executionHostId` resolve to a non-local runtime that already refuses? Spot-check breadth before choosing between "restore recovery" and "paired web stays out of scope".ℹ️ Nitpicks
- The PR description's "The gate" section (three required router fields) and bug-fix item 3 (message-substring thrown-refusal mapping) describe the pre-
67f2238design and no longer match the code. Worth updating so reviewers don't chase a gate that was deleted.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
macOS visual QA (Grok worker,
|
There was a problem hiding this comment.
ℹ️ No new issues in this delta. The Windows eligibility hardening and the identity/detailed process-table split are correct and keep structured chat fail-closed end to end. Not an approval: the paired-web host-swap gap raised in the prior review is unchanged by these commits and remains open.
Reviewed changes (delta against the prior review at 67f2238, commits a7398c07 + a2fcf33):
- Moved Windows eligibility fully onto the host's awaited probe —
getStatus()no longer dropsSTRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITYon win32 without proof;getStructuredAgentSessionCreateSupportnowawaitsprobeWindowsProcessStartTimeAvailability()and threads the proof intosupportsCodex/ClaudeStructuredLocation. Fail-closed is still guaranteed at four layers: the renderercreateSupportpreflight, the hostcreatere-check, the Codex launch resolver, and the attach-time ownership re-check. - Split the Windows process table into identity/detailed projections —
readWindowsProcessIdentityTable[Fresh]requestsCreationTimeonly,readWindowsProcessTable[Fresh]requestsCommandLineonly, and the loader moved towindows-process-tree-loader.ts. EverycreationTimeMsconsumer (agent-session-process-identity-probe,windows-descendant-exit-verification) migrated to the identity reader; no detailed-table consumer readscreationTimeMs. - Batched Windows start-time reads —
readProcessStartTimesMscollapses N per-PID scans into one identity snapshot. - Hardened the native addon patch verification — creation-time and command-line hunks are now asserted at build and runtime (
assertWindowsProcessTreeCreationTimePatch,assertWindowsProcessTreeRuntimeCreationTime), andProcessInfois value-initialized so memory is never stack garbage.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Final review status: ready from code/review/CI perspective at What the review changed and verified:
Visual/runtime evidence:
Residual validation gap: the packaged Windows artifact itself was not manually launched to exercise the post-launch re-probe, although the Windows package smoke job is green. The rapid-successive-message duplicate/drop observation remains unattributed and outside this routing-only PR's scope; this review did not expand into message-dispatch redesign. |
Take main's Windows CreationTime infrastructure wholesale: main's addon now self-reports supportedProcessDataFlags, so the async capability probe this branch carried (and the status/gate plumbing it forced) is unnecessary.
There was a problem hiding this comment.
Caution
This merge leaves the unit suite red: the foreground snapshot flag test asserts a projection split the merge silently dropped.
Reviewed changes (delta against the prior Pullfrog review at a2fcf33)
- Merged
main— brought in #18986 (fix(windows): unblock structured native chat by exposing process creation time) and dropped this PR's own addon patch, build tooling,windows-process-tree-loader.ts, and theprobeWindowsProcessStartTimeAvailabilitystate machine. Creation-time capability is now delegated to main'ssupportedProcessDataFlags-backedisWindowsProcessStartTimeAvailable(), andgetStatusAfterWindowsProcessStartTimeProbeis gone in favor of a synchronouswindowsProcessStartTimeAvailablefield ongetStatus(). - Lockfile stabilization —
1ef54a4eis lockfile-only. - Foreground snapshot flag test —
bf957c7re-alignedwindows-foreground-process-inspection-cost.test.tsto assert the pane snapshot requests onlyCommandLine(flags2), matching the pre-merge split whereDETAILED_PROJECTIONwasCommandLine-only.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Main asks for CreationTime on both projections; this branch's hot-path isolation went away with the async probe it served.
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the red foreground-snapshot test is fixed and green. Not an approval: the paired-web host-swap gap raised in the prior review is unchanged by this commit and remains open.
Reviewed changes (delta against the prior Pullfrog review at bd42eaa)
- Restored main's pane-snapshot flag contract —
windows-foreground-process-inspection-cost.test.tsnow asserts the pane snapshot requests flags6(CreationTime | CommandLine), matching main'sDETAILED_PROJECTION(IDENTITY_PROJECTION.flags | CommandLine), and renames the test to "never sets the Memory flag". The staletoBe(2)assertion is nowtoBe(6). Verified green locally (4/4 passing).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Main centralised the launch gate in structured-native-chat-launch-route, where it re-added the client-side codex+win32 refusal. Delete that blocker there instead, so the renderer and orchestration both stop guessing; createSupport still answers. Drops the now-unread platform input end to end. Also dedupes two shadowed lastActivityAt keys that arrived from main in #19127 and fail tsc; the later value already won, so behaviour is unchanged.
There was a problem hiding this comment.
ℹ️ No critical issues in this delta — one minor cleanup observation in the nitpicks.
Reviewed changes (delta against the prior Pullfrog review at 88ca86a)
Commit 61dd2e4 merges main and deletes the client-side Codex-on-Windows refusal that main re-introduced when it centralised the launch gate, so the refusal now lives entirely on the executing host.
- Moved the Codex Windows refusal onto the executing host —
resolveStructuredNativeChatSupportdrops thecodex-on-windowsblocker and theplatforminput; the renderer'sresolveAgentLaunchRouteand orchestration'sdecideWorkerStartModeboth stop guessing from the client platform. The host still fails closed atsupportsCodexStructuredLocation/createCodexStructuredLaunchResolver(win32 without creation-time proof is refused) and at orchestration'sresolveWorkerStartModeOnHost, which consults the hostcreateSupportfor the resolved worktree. - Dropped the now-unread
platforminput end to end — removed from the shared input type, the renderer router, the orchestration decision, and theworkers.tscall site. - Reverted
windows-descendant-exit-verification.tsanden-runtime-required.jsontomain's shape — their PR-local hunks were dropped in the merge and no longer appear in the PR diff. - De-duplicated two shadowed
lastActivityAtkeys infirst-work-branch-rename.test.tsthat arrived frommainand failedtsc.
The paired-web host-swap gap raised in the prior review is unchanged by this commit and remains open.
ℹ️ Nitpicks
codex_on_windowsis now dead insrc/main/runtime/rpc/methods/orchestration-worker-start-mode.ts: thecodex-on-windowsblocker was its only producer (throughBLOCKER_REASON), and this commit removed that mapping while leaving theWorkerStartModeReasonmember (line 40) and itsDOWNGRADE_DETAILentry (line 77) in place. The leftover detail string — "Codex has no structured session on Windows" — now states the opposite of what the PR ships. Remove the enum member and the detail entry.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Main's new launch-identity test doubles answered every RPC with one shape, so Codex's now-required createSupport probe read as unsupported.
There was a problem hiding this comment.
ℹ️ No new issues in this delta. The merge reconciliation is clean and preserves the host-side Windows gate for both providers. Not an approval: the paired-web host-swap gap and the dead
codex_on_windowsreason flagged in prior reviews remain open and unchanged.
Reviewed changes (delta against the prior Pullfrog review at 61dd2e4)
Commit 61ec13a merges main and keeps the executing-host createSupport probe for both Codex and Claude, reconciling this PR's fail-closed Windows gate with main's refactored acquisition/adoption code.
- Merged main's structured-session refactor —
acquireOwner(now imported fromstructured-agent-session-acquisition.ts) andimportAdoptedTranscript/prepareAdoptedTranscript(fromstructured-agent-session-adopted-import.ts) are adopted; the PR'sadapterSupportsCreateIfDeclaredre-checks inperformAttachandacquireNativeHandoffOwnersurvive the reconciliation, so the gate still fails closed before reserving/spawning and before unbinding the TUI owner. - Kept the host probe for both providers —
launchStructuredAgentSessionstill callsagentSession.createSupportbeforecreate(viarequireHostCreateSupport), andsupportsCodexStructuredLocationstill refuses win32 without creation-time proof. - Fixed the launch-identity test doubles —
structured-agent-session-launch-resume-identity.test.tsnow answersagentSession.createSupportwith{ supported: true }instead of falling through to the catch-all RPC shape, so the now-required probe no longer reads as unsupported and the suite's real intent-builder stays green. - Dropped the leftover
platforminput from the remaining renderer call sites (ai-vault-session-resume-in-chat-workspace.ts,folder-workspace-composer-submit.ts,full/quick-creation-execution.ts) and replaced the Codex Windows-refusal router test with an assertion that a staleplatformargument no longer flips either provider off the structured route.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
* fix(runtime): save a windowless host's chat tabs in its layout Claude-Session: p2-headless * fix(runtime): remove a chat's saved tab on the index's hidden notice, which every close reaches Claude-Session: p2-headless * fix(runtime): a chat whose record is gone loses its saved tab at startup Claude-Session: p2-headless * test: run the windowless chat-layout host test in the Node runtime project Claude-Session: p2-headless * fix(runtime): remove a chat's saved tab from whichever partition still holds it Claude-Session: p2-headless * refactor(runtime): list saved chat tabs across partitions in the layout module Claude-Session: p2-headless * refactor(runtime): read saved chat tabs straight from the store's partitions Claude-Session: p2-headless * fix(chat-tabs): save a windowless chat tab under its own tab id Review pass: the saved tab reuses the id status and attention address, the close checks for a window before scanning partitions, and the host tests seed readable records with unreadable, other-host and no-index cases. Claude-Session: p2-headless * test(chat-tabs): a window opening a windowless-saved chat reuses its tab Claude-Session: p2-headless * test(chat-tabs): check the saved tab with the lookup a window reuses The window's existing-tab lookup moves to the shared projection so the windowless-layout test exercises it without importing the renderer. Claude-Session: p2-headless * test(chat-tabs): assert the reused tab's identity directly Drops the shared lookup added for the test; two functions already carry that name. Claude-Session: p2-headless * fix(chat-tabs): leave an unstamped chat tab in an SSH partition to that host Claude-Session: p2-headless * fix(chat-tabs): count an unstamped chat tab as this host's only in the local partition A desktop mirrors a remote server's chats into that server's runtime partition without a host stamp; the startup sweep must not delete them. Claude-Session: p2-headless * refactor(chat-tabs): one chat tab writer, one startup match, local partition only Chats run only on local hosts, so their saved tabs live in the local partition: the cross-partition listing and its writer go. Open and close share one layout load, the startup fill and sweep become one function beside the index seed, and the tab filter is the existing savedSessionId. Claude-Session: p2-headless * fix(chat-tabs): restore and sweep saved Claude chat tabs like any structured chat The Claude skip predates Claude structured chats (#18519, #18560); an id the host has no record of is already dropped by the readable restorer. Claude-Session: p2-headless










Native Windows can now run structured Codex chat. Ownership is gated on a measured capability: the host must prove its process table exposes creation times before any PID is adopted.
Why this is a port, not a merge
This lane predates #18248, which deleted
canUseStructuredNativeChatand replaced it withresolveAgentLaunchRoute— still carrying a blanketplatform !== 'win32'refusal, the exact refusal this lane removes.Resolving that conflict the obvious way (take main's deletion) goes green on typecheck and lint while silently dropping the entire Windows enablement. So the gate is ported onto the new router instead.
The gate
resolveAgentLaunchRoutegains three required fields:windowsProcessStartTime: 'available' | 'unavailable' | 'unknown'worktreeUsesWslPath: booleanisWebClient: booleanRequired rather than optional is deliberate. An optional field silently defaults to
undefinedat any call site that forgets it, which here means silently refusing Windows with no compiler signal. Making them required made the compiler enumerate the call sites — and it immediately found a 7th behind a forwarding wrapper that a grep had missed.'unknown'is refused: a host that never answered the probe must never have a PID adopted against it.Paired web clients are refused too. A web client's
platformdescribes the browser's machine, not the host that will run the agent. Before this, a browser on macOS driving a Windows runtime read "not win32", skipped the creation-time proof and allowed structured chat — fail-open, bypassing the guarantee this lane is built on. The refusal is synchronous and fail-closed: no round-trip, no null window, no cache. Paired web gets the legacy chat until the host publishes eligibility itself, which is a separate change.Bugs found and fixed while merging
resolveStructuredAgentSessionLocation's folder branch tested!target.connectionId, but main removed that field ([Bug]: SSH worktree/terminal operations are validated locally instead of routing to the connected SSH target (DaemonProtocolError: working directory does not exist) #11163 — it spelled "remote", "unresolved" and "local" all asundefined). The check was permanently true; the file is@ts-nocheck, so nothing caught it. Both WSL branches now key onexecutionHostId.readWorktreeUsesWslPaththrew on an unhydrated store.status.getcalled a probe method the mobile RPC test double didn't implement — a pre-existing lane defect, red at the lane head, invisible because the file wasn't in the lane's test list and the lane had zero CI until this PR.fr.jsonentry main retired after my merge point — CI validates the PR merged with current base, so both read clean locally).Windows validation
Run on real hardware (Windows high spec) against the dev build from this branch:
codex.exe— PASSCapability proven on the machine itself: the patched process-tree addon returns
creationTimeMsfor its own PID, so the gate readsavailablerather than merely compiling.One open defect, not from this PR: rapid successive messages duplicated one prompt and dropped another. This PR only decides routing and does not touch message dispatch, so it is very likely a pre-existing structured-chat bug now reachable on Windows. Unattributed — worth confirming on macOS and filing separately.
Proof
pnpm tc0 · fulloxlint0 · changed-code quality 0 findings across 57 files (plain, type-aware, React Doctor)Review notes
d54189408f0,58f963180a6). They correctly identified that the gate should key on the execution host's platform rather than the client's — but the head already did that and refused on unknown, and their version made a synchronous input asynchronous for every desktop user to close a paired-web-only hole, widening a startup race. That hole is closed here fail-closed instead.repos-onboarding-folder-startup.test.tsneeded a module mock: the store path now reachesisWebClientLocation(), and the suite stubswindowwithoutlocation. Test-harness artifact — a real renderer always haswindow.location.Follow-ups (deliberately not here)
.cmdshim over the real.exe, inverted against PATHEXT's own default. Means the PID we hold can be a wrapper — relevant precisely because this PR's identity guarantee rests on holding the right one.