Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe CLI now classifies Priority: ⬇️ Low — Defer this CLI diagnostics change because it narrowly improves permission-denied versus absent-process reporting without supplied evidence of elevated customer or external urgency. Merge Risk: ⚪ Minimal · up to The CLI now distinguishes denied runtime access from a confirmed absent process while preserving existing behavior for ordinary connection and metadata failures. No current merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the implementation, motivation, testing scope, linked issue, and caveats. However, it omits most required template sections, including ELI5, Why, Visual Proof or N/A, Testing checkboxes, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. Resolution Reformat the description to include all required template sections. Add a brief ELI5 explanation, a Why section, Visual Proof with N/A and a reason if applicable, explicit Testing details and checkbox status, AI Disclosure, Review, Agent skill upstream boundary status, Notes covering compatibility and security considerations, and the required Checklist items. Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 7 files. (1 skipped: 1 unsupported.)
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.
ℹ️ Sound diagnosis and well-targeted tests, with a couple of adoption notes inline and below. Given the author has flagged this as evidence rather than a maintained branch, the main practical blockers to adopting it as-is are the stale base and the cross-platform gap noted below.
Reviewed changes
RuntimeAccessError+ errno classifier — newruntime-access-error.tsmapsEPERM/EACCESonto aruntime_unavailableerror carrying{ reason: 'permission_denied', operation, systemCode, processState: 'unverifiable' }.status.ts—isProcessRunningnow distinguishes permission-denied (throw), absent (ESRCH→false), and unknown (throwunverifiable);getCliStatusre-throws access errors instead of returning a healthyapp.running: false.transport.ts— the socketerrorhandler inspects the errno and raisesRuntimeAccessError('connect')on denial, keeping the "restart Orca" advice only for genuine unavailability.metadata.ts— denied metadata reads throw instead of being hidden asnull/a generic "start the app" message.cli-error.ts— stops appending "Orca is not running" whenprocessStateisunverifiable.- Tests / docs — two new deterministic test files driving
EPERM/EACCESthrough the realsendRequest/getCliStatuspaths plus rendered CLI output, askill-guides/orca-cli.mdnote, and the regenerated bundle.
ℹ️ Host-returned unverifiable still reads as "not running"
The new guard in formatCliError only covers the local RuntimeClientError path. A runtime_unavailable returned by an actual host is wrapped as RuntimeRpcFailureError and hits the block at cli-error.ts:78-81, which unconditionally appends Orca is not running. Run 'orca open' first. — even if the host's error.data.processState === 'unverifiable'. If the goal is for this vocabulary to flow end-to-end (the skill guide already documents reason: permission_denied arriving in error data), that path needs the same guard; today the CLI would re-assert the false negative it's trying to eliminate. This is forward-compat, not a regression the diff introduces, so it's flagged as informational.
ℹ️ Base is ~49 commits behind main with a conflict
The author calls this out in the PR body. The diff can't be evaluated against current main without a rebase, and the merge conflict indicator should be resolved before any of this is cherry-picked.
Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:
src/cli/runtime/cli-error.ts:52(RIGHT) — file not in PR diff
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| if ((error as NodeJS.ErrnoException | null)?.code === 'ESRCH') { | ||
| return false | ||
| } | ||
| throw new RuntimeClientError( |
There was a problem hiding this comment.
This unguarded else now throws runtime_unavailable for any unrecognized errno, where the old catch mapped every failure to false. On Windows (a first-class target here), process.kill(pid, 0) routes existence checks through OpenProcess + a different error translation than POSIX; if a genuinely absent process surfaces as anything other than ESRCH there, orca status/orca open will start throwing a confusing 'unverifiable' error instead of 'not running'.
…22341) * fix(cli): report a denied runtime connection instead of a dead Orca Inside Codex's macOS Seatbelt sandbox, connect() on the runtime socket fails with EPERM. The CLI dropped the errno and reported "Could not connect ... Restart Orca", appended "Orca is not running. Run 'orca open' first.", and `orca status` answered ok:true with `starting` (its pid probe also gets EPERM). An agent following that advice restarts a healthy app, which cannot help. EPERM/EACCES on the metadata read or the socket/pipe connect now fails with a CLI-local `runtime_access_denied` error: ok:false, non-zero exit, operation/systemCode/processState:"unverifiable"/retryable:false and nextSteps that say to re-run with escalated permissions and not restart. CODEX_SANDBOX only picks the wording. `orca open` stops before launching. The status pid probe is unchanged: a refused or missing socket proves the caller reached the endpoint, so a later EPERM probe is another uid and keeps #20098's `starting`. Missing, refused, stale-pid and timeout paths are unchanged. Adapted from the diagnosis and tests in #20487 (and #19605, #13583). Co-authored-by: lifeodyssey <[email protected]> * docs(skills): tell agents runtime_access_denied means escalate, not restart The shared CLI-resolution block told every bundled skill to run `orca open` when a command says Orca is not running. Add the counterpart for the new access-denied code so sandboxed agents re-run with escalated permissions instead of launching or restarting Orca. Regenerated stubs and manifest. * refactor(cli): classify only a denied runtime connect, with a leaner error A denied metadata read was never observed under a sandbox, and it turned an unreadable user-data path (the Linux launch contract's root-owned HOME) into runtime_access_denied instead of "Orca is not running". Keep metadata reads as on main and classify only the socket/pipe connect. One helper now maps a socket errno to the error or null; the error data keeps only systemCode and nextSteps. Tests drop cases already pinned by status.test.ts. * fix(cli): give not-running advice when a denied socket belongs to a dead Orca A crashed Orca leaves its metadata and socket file behind, and a sandbox denies the connect with EPERM before the CLI can see ECONNREFUSED. The sandbox still reports ESRCH for a gone pid, so a denied connect now probes the metadata pid and falls through to the ordinary unavailable path when the pid is proven gone. isProcessRunning moves to its own module so transport and status share it. * refactor(cli): inline the runtime_access_denied code like other CLI error codes --------- Co-authored-by: lifeodyssey <[email protected]>

Fixes the defect reported in #19604. Offered as evidence, not as a contribution we intend to maintain.
What this does
Teaches the CLI to distinguish "I am not permitted to look" from "it is not there."
src/cli/runtime/status.ts—isProcessRunninghad a barecatchthat turned everyprocess.kill(pid, 0)failure intofalse. Now:EPERM/EACCES→ throwRuntimeAccessError('probe_process', code)— the process exists, we simply cannot signal itESRCH→false, genuinely absentRuntimeClientError('runtime_unavailable', …, { processState: 'unverifiable' })rather than guessinggetCliStatusre-throwsRuntimeAccessErrorinstead of folding it into a healthy-looking response withapp.running: false.src/cli/runtime/transport.ts— the socket error handler wassocket.once('error', () => …), discarding the error object entirely and always recommending a restart. It now inspects the code and raisesRuntimeAccessError('connect', code)on a permission error, keeping the restart advice only for genuine unavailability. That advice mattered: restarting Orca to clear a permission denial would kill every running terminal.src/cli/runtime/cli-error.tsandmetadata.ts— stop appending "Orca is not running" to a denied read, and stop hiding denied metadata reads.New:
src/cli/runtime/runtime-access-error.ts(+24) withisRuntimePermissionErrorand theRuntimeAccessErrortype.9 files, +283/−13. About 200 of those lines are tests —
runtime-access-diagnostics.test.ts(+156) andmetadata-access-diagnostics.test.ts(+48) — driving deterministicEPERM/EACCESfixtures, includinggetCliStatusthrough the realsendRequestimplementation and the rendered JSON and human-readable CLI error output.Note the diff's byte size is dominated by
skill-guides/orca-cli.mdand the regeneratedbundled-skill-guides.tsstring, which together are larger than the logic change.Caveats
a278d84a, now ~49 commits behindmain, with 1 conflict indicator against currentmain. Needs a rebase we have not done.skill-guides/orca-cli.mdreflects our usage and you may want to word it differently or drop it.Provenance
As with #19590, this was written by one of our automated agents during an incident. It diagnosed the defect correctly — including reproducing the
EPERMdifferential with an Electron-free Python probe to rule out the Electron codesign warning as the cause — but it also went well beyond its remit, cloning this repository and writing fixes across five branches while consuming a large amount of our Codex quota. That was our process failure, not yours.We are publishing it so the diagnosis is not wasted. We are not planning further work here and are not offering to maintain this branch. Take it, rewrite it, cherry-pick just the tests, or close it — whatever is most useful. No response needed on our account.
Of the two reports, #19604 is the one we would prioritise if we were you: the current behaviour makes the CLI assert a false negative and recommend a destructive remedy, which automation cannot distinguish from a real outage.