Repository navigation
fix(cli): stop permission-denied runtimes reporting starting - #16697
brennanb2025 wants to merge 4 commits into
Conversation
|
Warning Review limit reachedNext included review available in 21 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe runtime transport now classifies Merge Risk: ⚪ Minimal · up to This localized CLI change preserves permission errors and reports the existing runtime status instead of incorrectly showing startup; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description is complete and focused. It explains the problem, changes, rationale, linked issue, lack of visual changes, testing results, security and compatibility considerations, and the limits of local validation. The linked issue is identified, and the unchecked full-repository checks are clearly disclosed. ✨ 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: Pro Plus
Run ID: 6c37bb54-51b9-4596-9172-fb3be6474157
📒 Files selected for processing (4)
src/cli/runtime/status.test.tssrc/cli/runtime/status.tssrc/cli/runtime/transport.test.tssrc/cli/runtime/transport.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.
|
Review verification for exact head |
|
QA/blocker evidence for exact head Local verification passed focused runtime tests 22/22, adjacent CLI/error tests 12/12, |
|
Closing as superseded: a merged PR already covers this change. #22341 (9af6a3d) makes EPERM/EACCES on the runtime socket/pipe a runtime_access_denied error (src/cli/runtime/runtime-access-denied.ts), so status no longer reports 'starting'. Same fix, same (Stale-PR cleanup 2026-10-20, approved by Brennan. Reopen if something here is still missing on main.) |
ELI5
When a restricted Windows account cannot open Orca's named pipe, the CLI currently throws away the permission error and reports that the already-running app is still starting. This change preserves the OS error and returns an existing terminal status instead, so callers do not wait forever for a startup that already finished.
What Changed
EPERM/EACCES, errno, syscall, and transport kind when a local runtime connection is denied.runtime_permission_deniedwithout recommending an Orca restart that recreates the same permissions.stale_bootstrap/not_runninginstead ofstarting/starting.RuntimeClient.getCliStatus()failure path for both permission-denied and transient connection failures.Why
Windows Codex sandboxes run commands under a separate account. That account can discover the runtime metadata and live PID but cannot open the default duplex named pipe, so PID-only classification leaves
orca statusonstartingforever. Keeping the existing runtime-state enum avoids a mixed-version contract change while the new local error code and structured data preserve the actual cause.Linked Issue
Addresses #13539 (the independently fixable diagnostics/status half of STA-3813). The native least-privilege named-pipe reachability half remains open.
Visual Proof
N/A — this changes CLI transport errors and JSON/status projection only; there is no rendered Electron UI change.
Testing
EPERM/-4048reproduction is recorded on the linked issue.Verified with Node 24.19.0:
pnpm test src/cli/runtime/status.test.ts src/cli/runtime/transport.test.ts— 20 passed.pnpm run check:code-quality:changed— passed with zero findings across four changed files.pnpm tc:cli— passed.git diff --check— passed.AI Disclosure
Review
CliRuntimeStateunion; the new error data is local-CLI-only and additive. Remote wire framing, SSH/WSL host ownership, folder workspaces, mobile contracts, Git providers, and Git commands are unchanged.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
The current Node named-pipe client opens duplex with generic write access, whose pipe mapping includes the create-instance-equivalent bit. The linked issue explicitly excludes granting that right, and the offline sandbox blocks a loopback TCP fallback, so native least-privilege reachability remains separate from this safe diagnostics fix.
Checklist
N/Awith reason.pnpm lint, repository-wide typecheck/test, and build were not run locally; focused tests, changed-code quality, and CLI typecheck passed, with CI expected to cover the wider repository.