Repository navigation
fix(wsl): publish the resolved WSL hosts gate state to child processes (kill switch follow-up) - #35543
Conversation
|
STATUS: ready for review. Head 407b074, stacked on #35529. Load-rule checks pass locally: tc, typecheck:ci, 12 touched or gate-reading test files each run on its own, check:code-quality:changed, anti-slop oxlint, ast-grep gates. Reviewer: fix-reviewer (pending). Open question: the approach publishes the resolved gate state instead of clearing ORCA_INTERNAL_WSL_HOSTS, so a relaunch keeps fetching the policy. The team lead was told and can redirect. |
|
STATUS: head e0922d1. Added the team lead's constraint: main never reads an inherited ORCA_WSL_HOSTS_GATE_STATE. It is ignored from main's entry (before preflight), recomputed from the env flag and the policy, and overwritten, with tests for a stale inherited closed and open. Load-rule checks pass again: tc, typecheck:ci, 12 gate-reading test files each run on its own, code-quality, anti-slop, ast-grep gates. Still stacked on #35529; the team lead retargets after it merges. Reviewer: fix-reviewer (pending). |
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryMain publishes its resolved WSL hosts gate through
No actionable issues were found.
|
6fe1411 to
3fd1e58
Compare
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
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 |
Children inherit ORCA_INTERNAL_WSL_HOSTS=1 even when a remote policy block closed the gate, and none inherit serve-only. Main now publishes its resolved state as ORCA_WSL_HOSTS_GATE_STATE at startup, and the shared serving check in a child trusts it over the internal gate env. A process that resolves the gate itself ignores an inherited value, so a relaunch never carries a stale state. ORCA_INTERNAL_WSL_HOSTS is left intact so a relaunched or updated Orca keeps fetching the policy. Co-Authored-By: Claude <[email protected]>
…st line A relaunch or the updater's installer inherits the parent's published ORCA_WSL_HOSTS_GATE_STATE. Main's entry now marks the gate as its own to resolve before preflight, so even a read before configure falls back to the internal gate env, and configure always overwrites the value. Tests pin that a stale inherited closed or open is ignored and overwritten. Co-Authored-By: Claude <[email protected]>
e0922d1 to
08ad245
Compare
|
STATUS: rebased onto main (9b1540c) after #35529 merged. Head 08ad245. The base is main. The range-diff against e0922d1 changes no production code. The only difference is src/shared/wsl-host-internal-gate.test.ts: #35394 deleted that suite on main, so this PR recreates it with only its own tests (inherited-state cases). The deleted cases are not restored. Load-rule checks pass again: tc, typecheck:ci, 12 gate-reading test files each run on its own, code-quality, anti-slop, ast-grep gates. |
#35667 pruned src/shared/wsl-host-internal-gate.test.ts as a lone suite, dropping #35543's child-side cases. Two non-redundant ones return inside wsl-host-gate.test.ts: a child of a blocked run trusts the published closed over ORCA_INTERNAL_WSL_HOSTS=1 (and serve-only with no env), and falls back to the env when nothing valid was published. The main-side cases were already there. Co-Authored-By: Claude <[email protected]>
#35765) #35667 pruned src/shared/wsl-host-internal-gate.test.ts as a lone suite, dropping #35543's child-side cases. Two non-redundant ones return inside wsl-host-gate.test.ts: a child of a blocked run trusts the published closed over ORCA_INTERNAL_WSL_HOSTS=1 (and serve-only with no env), and falls back to the env when nothing valid was published. The main-side cases were already there. Co-authored-by: Claude <[email protected]>
Follow-up to #35529 (merged).
ELI5
When the remote kill switch blocks WSL hosts, the Orca app knows about it, but the programs Orca starts don't: the
orcacommand line, servers and terminals. They still see the "WSL hosts on" setting they inherited. This PR has the app hand its final on/off answer down to those programs.What Changed
src/shared/wsl-host-internal-gate.ts:open,serve-onlyorclosed) asORCA_WSL_HOSTS_GATE_STATEin its own environment. Every child process it spawns inherits it.isWslHostsServing, the only gate reader outside main) trusts that value overORCA_INTERNAL_WSL_HOSTS.src/main/index.ts) marks the gate as its own to resolve before preflight, so even an early read falls back to the internal gate env. A relaunch or the updater's installer can therefore never carry a parent's state.src/main/wsl/wsl-host-gate.ts:configureWslHostsGaterecomputes from the internal gate env and the policy, then overwrites the published value on every path. The test reset withdraws it.Before:
orcaCLI treated WSL host state as served. An unreadable WSL host record made it throw instead of being skipped.After: children read the gate exactly as main does.
Why
The first idea was to delete
ORCA_INTERNAL_WSL_HOSTSfrom main's environment during a blocked run. I didn't, becauseapp.relaunchand the installer the updater launches both inherit main's environment. The next Orca would then lose the internal gate, stop fetching the policy, and never learn a laterallow. Publishing the resolved state instead leaves the tester's setting intact, and it also fixes the older serve-only gap.Flag-off: with
ORCA_INTERNAL_WSL_HOSTSunset and nothing saved, children seeclosed, the same as their behavior today. Serve-only children now correctly seeserve-only.Status
Ready. Rebased onto main after #35529 merged. Head
08ad2450443. Checks run locally:pnpm tc,pnpm run typecheck:ci, each touched or gate-reading test file run on its own (12 files),check:code-quality:changed, anti-slop oxlint, ast-grep gates. One reviewer requested: fix-reviewer.Linked Issue
Internal: WSL-host kill switch follow-up (child-process caveat from the #35529 review).
Visual Proof
N/A: no UI change. This only affects how child processes read the gate.
Testing
wsl-host-internal-gate.test.ts:closedoverORCA_INTERNAL_WSL_HOSTS=1, and the publishedserve-onlywith the env unset.wsl-host-gate.test.ts:closed(internal gate on) oropen(gate off), recomputes, and overwrites it.Review
Agent skill upstream boundary
Notes
ORCA_*variable.Checklist
N/Afor visuals, with reason