fix(windows): preserve scheduled-task elevation launcher arguments - #1860
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe scheduled-task elevation launcher now assembles PowerShell fragments without splitting ChangesWindows elevation launcher
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change is localized and no actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. |
|
@coderabbitai review |
|
The branch is based on the current dev head and the deterministic repository checks are green. Cross-platform CI and React Doctor are still awaiting fork-workflow approval and currently contain zero jobs. Could a maintainer approve those workflow runs? |
✅ Action performedReview finished.
|
704d2f0 to
f10161d
Compare
|
@coderabbitai review |
|
|
CodeRabbit's linked-issue warning about the adjacent |
Ingwannu
left a comment
There was a problem hiding this comment.
Maintainer review of exact head 6e68c0ebb is positive on scope and security boundary.
The diff keeps Start-Process, -FilePath, -ArgumentList, -Verb RunAs, and -Wait in one statement while preserving the trusted System32 PowerShell path, immutable encoded XML transport, UAC cancellation mapping, and elevated exit-code protocol. I reran the focused suite (52/52), typecheck, privacy scan, and diff check successfully.
This remains a draft with only the lightweight checks currently available. Please mark it ready and complete the exact-head cross-platform CI/readiness gate before merge. No separate Go-native counterpart exists for this TypeScript Windows installer path.
…d-task-elevation-launcher
Wibias
left a comment
There was a problem hiding this comment.
Reviewed exact head b58ac6a7a75fff452aecfe3bfd760d19b4711af3.
Approve. I found no actionable P0-P2 code, security, compatibility, architecture, or test-coverage issue in this change.
The fix is correctly scoped to the malformed outer PowerShell launcher: Start-Process, -FilePath, -ArgumentList, -Verb RunAs, and -Wait now remain one statement, matching the established runWindowsElevated() construction. The trusted System32 PowerShell resolution, encoded immutable XML transport, UAC cancellation handling, and elevated exit-code protocol remain intact.
The focused regression is strong enough to catch the original failure by asserting the first statement terminator occurs only after -Wait and rejecting the previously split launcher shapes. The existing elevation suite also covers XML transport, cancellation, exit-code propagation, launch failure, signal termination, and timeout behavior.
I also reviewed the earlier CodeRabbit concern about the adjacent }exit boundary. It is not actionable: the same launcher shape already exists in runWindowsElevated(), and the exact boundary was verified under Windows PowerShell 5.1 for both normal child exit-code propagation and the missing-ExitCode protocol path.
No docs/config/dependency/database change is required for this bug fix.
Cross-platform CI for this exact head is still running at review time, so this approval is for the code itself; merge should still wait for the required exact-head CI to finish green.
|
Thanks @ulrich-zogo — this is a really useful fix. It restores the fresh Windows service-install path from a non-elevated shell so the UAC prompt and scheduled-task registration actually run, while keeping the trusted System32 PowerShell resolution, encoded XML transport, cancellation handling, and exit-code protocol intact. The focused regression test also protects this exact launcher-shape bug from coming back. Merged — appreciate the tight scope and solid verification. |
Summary
-FilePath,-ArgumentList, and-Verb RunAsin oneStart-Processstatement for elevated scheduled-task registration.Closes #1843
Verification
b58ac6a7a75fff452aecfe3bfd760d19b4711af3.dev:02da6cc9099db02873d6a38894af9b73d11f9f18.bun test tests/windows-elevation-spawn.test.ts— 52 pass, 0 fail, 175 assertions on final HEAD with Bun 1.3.14 on Windows 11.bun test --isolate tests/provider-workspace-data.test.ts— 48 pass, 0 fail, 180 assertions after the clean CI-equivalent GUI bootstrap.bun run prepushpassed with exit code 0 on exact final HEAD under Ubuntu 24.04 / WSL2 with Bun 1.3.14, after installing both root and GUI frozen dependencies and buildinggui/dist, matching the repository CI bootstrap. Full result: 12,714 pass, 15 skip, 0 fail, 159,070 assertions.bun run typecheck— passed on final HEAD.bun run privacy:scan— passed on final HEAD.git diff --check upstream/dev...HEAD— passed on final HEAD.opencodex-proxytask is installed and running on port 10100, so the fresh-install path could not be exercised without deleting the user's task.No documentation change was required because this restores the already documented Windows elevation behavior.
Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.