Repository navigation
fix(orcad): provide the orca CLI in Windows managed-host terminals - #27324
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The changes add the Windows launcher build test to the relevant classification and test run; no actionable merge-blocking risk remains. Pre-merge checks |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/actions/prepare-windows-cli-launcher/action.yml (1)
33-38: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReject unknown architectures before
rustup target add.An unknown arch value makes
$triples[$arch]evaluate to$null. In that case,rustup target addruns with no target and fails with an unclear usage error. Add an explicit check. The build script already rejects unsupported architectures, but that check runs after therustupstep.Proposed fix
foreach ($arch in ($env:ARCHES -split ' ' | Where-Object { $_ })) { + if (-not $triples.ContainsKey($arch)) { throw "Unsupported Windows CLI launcher arch: $arch" } rustup target add $triples[$arch]
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ea070778-3062-485c-beb2-535e9a213812
📒 Files selected for processing (19)
.github/actions/prepare-windows-cli-launcher/action.yml.github/workflows/e2e.yml.github/workflows/node-server-tests.yml.github/workflows/pr.yml.github/workflows/ssh-windows-hosts.yml.github/workflows/win-orcad-serve-switch-e2e.ymlconfig/scripts/build-orcad.mjsconfig/scripts/build-windows-cli-launcher.mjsconfig/scripts/build-windows-cli-launcher.test.mjsconfig/scripts/node-server-change-scope.mjsconfig/scripts/orcad-windows-cli-launcher.mjsconfig/scripts/orcad-windows-cli-launcher.test.mjsconfig/scripts/pr-code-change-scope.mjsnative/windows-cli-launcher/src/main.rssrc/main/cli/orca-cli-child-path.test.tssrc/main/orcad/orcad-cli-launcher.test.tssrc/main/orcad/orcad-cli-launcher.tssrc/main/ssh/orcad-windows-host-lane.test.tssrc/shared/orcad-artifacts.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
f834e30 to
35aeef8
Compare
35aeef8 to
858d78c
Compare
ELI5
On a Windows computer you reach over SSH, terminals that Orca's managed server (orcad) starts had no
orcacommand. Linux and macOS servers have had one since #26539. This PR gives Windows servers the same command, so agents and people in those terminals can runorca status,orca orchestration send, and the rest.Until now the old SSH relay supplied
orcaon Windows. The relay removal (#27214, #27215) takes that away, so this has to land first.What Changed
What users see
orcawas "not recognized", in cmd, PowerShell and Git Bash alike. Only relay-hosted terminals had it.orcaworks in every orcad terminal on that host, whichever shell the host's OpenSSHDefaultShellpicks. It runs the server's own CLI against that server's profile, exactly like the Linux and macOS launcher does. A multi-line or quote-heavy--bodyreaches the CLI unchanged.Mechanism
native/windows-cli-launcher, the Rustorca.exe). The reason it exists is that cmd.exe re-parses%*and cuts a message at its first newline. The launcher now has a second mode: when anorca-launcher.cfgfile sits beside it, it reads three lines (node=,cli=,user-data=). It then setsORCA_USER_DATA_PATH, clearsNODE_OPTIONS,NODE_REPL_EXTERNAL_MODULEandELECTRON_RUN_AS_NODE, and starts pinned Node on the slot's CLI with each argument kept as its own argv entry. That is the same work the POSIXshlauncher does. With no config file, the desktop mode is unchanged.bin/orca.exeforwin32-x64andwin32-arm64(ORCAD_WINDOWS_CLI_LAUNCHER_FILENAME). Because it is a slot artifact, it enters the version hash, the remote install probe and the template verifier. CI builds it on Windows runners through a newprepare-windows-cli-launcheraction. arm64 is cross-compiled on the x64 template lane, the same way the process-table addon is.build-windows-cli-launcher.mjsgains--arch.<profile>\cli\bin\orca.exe, only when the bytes differ, and writes the config beside it. A runningorcakeeps its image locked, so if that blocks the copy, the old exe is renamed aside and removed on a later start. This is the same stable profile path the POSIX launcher uses, so terminals that outlive a slot update still reach the new slot.prependOrcaCliDirToChildPathalready puts the launcher's directory first onPathand setsORCA_CLI_COMMANDandORCA_USER_DATA_PATHon Windows once a launcher exists. A new test pins that.Authority: unchanged. The launcher only fixes the profile and strips Node and Electron preload variables. Terminal-scoped credentials still come from the terminal's environment, and the server still decides what each caller may do; desktop control stays
blockedon orcad.Why
.cmdshim: cmd.exe re-parses%*, so newlines,%,^and quotes in a message body get cut or expanded. The desktop'sorca.cmdrefusesorchestration send/replyfor exactly this reason. That would leave Windows servers below Linux and macOS..ps1or a PowerShell function: the default execution policy blocks scripts, cmd and Git Bash don't see them, and agent CLIs startorcathrough their own child shells. Bypassing the policy is an EDR signal we avoid.orca.exewas flagged before ([Fixed - Verifying] [Bug]: Windows CLI launcher (resources/bin/orca.exe) quarantined as malware by enterprise EDR #23383). The native launcher was built to avoid that shape. It carries a version block and theorca.exeoriginal filename, and is never renamed.None of this depends on relay code. The branch also merges cleanly onto #27214's client and server branches.
Linked Issue
Fixes #
Follow-up to #26539 (CLI on managed POSIX hosts); blocker for #27214 / #27215.
Visual Proof
N/A: there is no UI. The behaviour is a terminal command, and the Windows SSH host cells below are the proof.
Testing
orcad-cli-launcher.test.ts: on a Windows host, orcad installsorca.exeand the config that points at this slot, runtime and profile, with no.cmdor.ps1beside it. It refreshes both on a slot switch, and a slot without the exe gets no command. Both install tests fail on main (expected null to be '…/cli/bin/orca.exe').orca-cli-child-path.test.ts: Windows env injection (Pathfirst,;delimiter, no POSIX restore dir, profile and command set).build-windows-cli-launcher.test.mjs(Windows, now registered inpackage_windows): builds the real launcher and runs it in server mode, from PowerShell with a multi-line body and directly with quotes, backslashes,%PATH%and^. It checks argv, the profile override and the strippedNODE_OPTIONS/ELECTRON_RUN_AS_NODE.orcad-windows-cli-launcher.test.mjs: template staging, PE machine check, and a refusal off Windows.orcad-windows-host-lane.test.ts(SSH Windows host cells, x64/arm64 × inbox/preview, cmd and PowerShellDefaultShell): after a real deploy,<profile>\cli\bin\orca.exe status --jsonreports the runtime reachable and desktop controlblocked.Local:
pnpm tc,pnpm lint, oxlint,check:code-quality:changed, focused suites.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
bin/orca.exesimply gets no command, the same as before.orca.exeis built in CI like the other template binaries. Whether release signing covers template contents is unchanged by this PR.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)