Skip to content

fix(cli): report a denied runtime connection instead of a dead Orca - #22341

Merged
Jinwoo-H merged 5 commits into
mainfrom
jinwoo/cli-runtime-access-denied
Sep 23, 2026
Merged

Jinwoo-H merged 5 commits into
mainfrom
jinwoo/cli-runtime-access-denied

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​151 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​151
Prod 15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​189 $\color{#cf222e}{\Huge{\mathbf{−}}}$​135 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​54

ELI5

When the orca command runs inside a sandbox (for example Codex's), the sandbox can stop it from talking to Orca even though Orca is running fine. Until now the command read that as "Orca is dead" and told the agent to restart Orca or run orca open, which can't help and interrupts a working app. Now the command says what happened: access was denied. Run it with more permissions; don't restart anything.

What Changed

Before, inside Codex's workspace-write sandbox on macOS, with Orca running:

  • orca status --json → exit 0, ok: true, runtime.state: "starting", reachable: false, connectionState: "disconnected". Older builds reported stale_bootstrap with app.running: false instead.
  • orca worktree list → Could not connect to the running Orca app. Restart Orca and try again. / Orca is not running. Run 'orca open' first.

After, same setup:

  • Every runtime command, orca status included, fails with exit 1 and ok: false, error.code: "runtime_access_denied":
    The Codex sandbox blocked this command from connecting to Orca (EPERM). Orca may be running normally.
    Next step: Re-run this command with escalated permissions, outside the Codex sandbox.
    Next step: Do not restart Orca or run 'orca open'; a restart cannot grant this command access.
    
  • --json output includes data: { systemCode, nextSteps }.
  • Outside the sandbox nothing changes: ready, reachable, same worktree list.

Mechanism. The socket/pipe connect in transport.ts used to turn every socket error into runtime_unavailable with restart advice. It now passes the error to runtimeAccessDeniedError (src/cli/runtime/runtime-access-denied.ts), which returns a runtime_access_denied error for EPERM/EACCES and null otherwise. The decision depends only on that error code, with one exception: if Orca crashed, it leaves its metadata and socket file behind, and the sandbox denies the connect before the CLI could see "connection refused". So a denied connect also probes the metadata pid with isProcessRunning (moved from status.ts to runtime-pid-liveness.ts so both files share it). The sandbox still reports ESRCH for a gone pid (verified inside Seatbelt), so a proven-dead pid falls through to the ordinary path: orca status reports stale_bootstrap, and other commands say "Orca is not running. Run 'orca open' first." A live pid, or EPERM from the pid probe, keeps runtime_access_denied. The CODEX_SANDBOX variable only changes the wording: with it set, the message names the Codex sandbox and says to re-run with escalated permissions; without it, a generic message says the command's sandbox or OS permissions block the connection. orca status (status.ts) re-throws this error instead of falling back to its kill(pid, 0) guess. formatCliError already prints nextSteps for any client error, so the new code never reaches the branch that adds "Orca is not running. Run 'orca open' first." orca open checks status before it launches the app, so a denial now stops it before it starts a second app or polls. The shared skill-resolution block that every bundled skill carries gets a sentence telling agents that this code means "escalate, don't restart".

Reading orca-runtime.json is unchanged: an unreadable file still means "not running". Sandboxes that block the socket (Codex's Seatbelt included) still allow that read, and an unreadable user-data path (for example a HOME owned by another user, as in the Linux launch contract) really does mean there is no Orca this user can reach.

Unchanged otherwise: missing metadata → not_running. Refused or missing socket plus a gone pid (ESRCH) → stale_bootstrap. Refused socket plus a live pid → starting. Timeouts behave as before. Nothing retries a denied connection, and no request bytes are written.

The pid check keeps #20098's behavior. status.ts now re-throws a denied connection before the pid check runs, so a sandboxed caller never reaches it. When the check does run, the socket either refused the connection or wasn't there. That proves the caller reached the endpoint, so the sandbox isn't what failed. An EPERM from the pid check at that point means the process belongs to another user, and "don't restart" would be the wrong advice. It still reports starting (a test pins this).

Why

The sandbox blocks the connection, so the CLI can't know whether Orca is healthy. Any status value (starting, stale_bootstrap, not_running) would be a guess, and agents act on those values. Failing the command, with a message that says Orca may be running normally, is the only honest answer. It's also what docs/reference/ssh-execution-boundary.md asks for: losing contact is never evidence that a process is dead.

Alternatives considered:

Code name: runtime_access_denied describes what the caller experienced (it was denied access), matches the EACCES family, and stays distinct from runtime_unavailable, which existing recovery logic (for example the orchestration "outcome unknown" list) treats as "maybe the request landed". A denied connection never sends a request, so it must not join that list.

Linked Issue

Fixes STA-8126. Addresses #19604 (diagnostics portion of #12528 / #13539). Windows named-pipe denials (STA-3813) take the same path because they're classified by the same EPERM/EACCES codes.

Visual Proof

N/A: CLI-only change, no rendered UI. Instead, real Codex agent sessions were run against real Orca instances with the CLI built from this PR's head (9fdfb94d4d). Only read-only Orca commands were used.

Each run was codex exec (Codex 0.155.1, gpt-5.6-sol) with this prompt: "Run <cli> status --json then <cli> worktree list --json; report the exact output; tell me what I should do next." In the sandboxed runs, CODEX_SANDBOX read seatbelt inside the session.

1. Live Orca, from an Orca terminal on the running app:

Case Codex permissions CLI Result What Codex told the user
Before --sandbox workspace-write, network off released 1.4.208 status: exit 0, ok: true, starting, unreachable. worktree list: runtime_unavailable "…Restart Orca and try again." "Orca is running, but its runtime is still starting and unreachable. Wait briefly and retry the two checks. If it remains unavailable, restart Orca manually, then retry."
After same this branch both commands: exit 1, runtime_access_denied, systemCode: EPERM, Codex wording and both next steps "Next: run those same commands from a terminal outside the Codex sandbox or with permission to access the Orca runtime. Do not restart, open, or kill Orca."
Control --dangerously-bypass-approvals-and-sandbox (Orca's YOLO launch) released and this branch ready, reachable, connected; 138 worktrees "No action is needed."
Manual permissions no flags (how Orca launches Codex in Manual mode) released and this branch ready; 138 worktrees "No action is needed."

The Manual row passes because this machine's ~/.codex/config.toml sets sandbox_mode = "danger-full-access". With a stock config, Manual mode runs in Codex's workspace-write sandbox, which is the Before/After row.

2. Orca that crashed while its terminals survived (the dead-pid path): an isolated Orca (this branch's build, orca-dev serve, its own user-data dir) with one terminal. The terminal ran a script that first ran the sandboxed Codex session against the live instance, then waited while the Orca main process was SIGKILLed. The terminal daemon and the terminal's shell survived, and the runtime metadata and socket file were left behind. The same shell then ran the sandboxed Codex sessions below.

Case CLI Result What Codex told the user
Live, before the kill this branch both commands: exit 1, runtime_access_denied, EPERM "Rerun those commands from a terminal outside the Codex sandbox or with escalated permissions. Do not restart or open Orca."
Dead, after the kill this branch status: exit 0, stale_bootstrap, app.running: false. worktree list: exit 1, runtime_unavailable "…Restart Orca and try again." (plain-text output adds "Orca is not running. Run 'orca open' first.") "Next: open or restart Orca yourself, then rerun the worktree-list command."
Dead, after the kill released 1.4.208 same as this branch "Next: manually start or restart the Orca app, then rerun these checks."

Inside the same Seatbelt sandbox, the OS-level probe against the leftover files gave connect EPERM and kill(pid, 0) ESRCH, so the dead-Orca run did take the new pid-probe fallback rather than a refused connection. The denial does not leak into this case: no "don't restart" text appears.

In the sandboxed runs Codex first read the installed orca-cli skill stub, which predates this PR and still says "if Orca is not running, run orca open". In the denied runs it followed the new error's guidance anyway.

Testing

  • I manually tested these changes locally (macOS: real codex exec sessions, sandboxed and unsandboxed, against the running Orca from an Orca terminal and against an isolated Orca killed with SIGKILL while its terminal survived, as above; read-only commands, no restart of the user's Orca)

  • Automated tests added/updated

  • runtime-access-denied.test.ts covers: EPERM/EACCES on connect with no restart or not-running text and no request bytes written; Codex versus generic wording; ECONNREFUSED staying runtime_unavailable; orca status failing without a pid probe; orca open not launching; the --json envelope; and a denied connect plus a dead pid (ESRCH) giving not-running advice and stale_bootstrap with no "don't restart" text, while a live or EPERM pid keeps the denial. The dead-pid test fails without the pid probe. The existing status.test.ts pins fix(cli,relay): stop reading an unsignalable pid as a dead one (+ unverifiable-collapse sweep result) #20098 (a missing socket plus an EPERM pid check still reports starting). With transport.ts reverted to main, all 6 denial tests fail; with only status.ts reverted, the 3 status/open tests fail.

  • pnpm tc; pnpm tc:cli; full src/cli suite (129 files, 1328 tests); pnpm run check:code-quality:changed; oxlint; oxfmt; verify:bundled-skill-guides; verify:skill-bundle-manifest. An unreadable user-data path still prints "Orca is not running. Run 'orca open' first." (the Linux CLI launch contract). Inside codex sandbox (workspace-write), a temp user-data dir with metadata pointing at a dead pid and a leftover socket file gave connect EPERM / kill ESRCH at the OS level; the rebuilt CLI reported stale_bootstrap for status and "Orca is not running. Run 'orca open' first." for worktree list, while the live Orca still gave runtime_access_denied.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Remote/SSH: no change to the RPC or stream format. The code is CLI-local and raised only by the local socket/pipe path. A host-reported error envelope with this code prints exactly as sent, with no local restart advice (tested).
  • Windows: named-pipe EPERM/EACCES hits the same check. It isn't tested on a real Windows sandbox; the unit tests fake the errno.
  • Backward compatibility: scripts that read orca status exit 0 plus reachable: false as "not ready yet" now get exit 1 when access is denied, which is intended: before, they waited forever on a state that could never change.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Jinwoo-H and others added 2 commits September 22, 2026 18:21
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]>
…estart

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.
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: a61837a3-5161-49f1-b3f7-01a2bd1589af

📥 Commits

Reviewing files that changed from the base of the PR and between 8af3cb0 and 9fdfb94.

📒 Files selected for processing (5)
  • src/cli/runtime/runtime-access-denied.test.ts
  • src/cli/runtime/runtime-access-denied.ts
  • src/cli/runtime/runtime-pid-liveness.ts
  • src/cli/runtime/status.ts
  • src/cli/runtime/transport.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The CLI now classifies EPERM and EACCES socket errors as runtime_access_denied and varies the error guidance when CODEX_SANDBOX is set. The skill guides describe retrying with escalated permissions and not opening or restarting Orca. The current manifest and snapshot registry have refreshed metadata for eight skills.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 9fdfb

Rare runtime metadata I/O failures can incorrectly report Orca as stopped, and users outside a sandbox may receive incomplete recovery guidance for permission-denied connections. Address these bounded correctness issues before merge if possible.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: the CLI reports denied runtime connections instead of treating Orca as dead.
Description check ✅ Passed The description covers the required explanation, user-visible changes, rationale, linked issue, visual-proof status, testing, upstream-boundary check, and compatibility notes. The AI Disclosure and Re…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: da739aa9-9ced-4ccd-b88e-7df87c9bdceb

📥 Commits

Reviewing files that changed from the base of the PR and between 7240368 and 0b11f50.

📒 Files selected for processing (17)
  • resources/skills/current-manifest.json
  • resources/skills/snapshot-registry.json
  • skill-stubs/_shared/cli-resolution.md
  • skills/computer-use/SKILL.md
  • skills/linear-tickets/SKILL.md
  • skills/orca-cli/SKILL.md
  • skills/orca-emulator-android/SKILL.md
  • skills/orca-emulator/SKILL.md
  • skills/orca-linear/SKILL.md
  • skills/orca-per-workspace-env/SKILL.md
  • skills/orchestration/SKILL.md
  • src/cli/runtime/metadata-access-denied.test.ts
  • src/cli/runtime/metadata.ts
  • src/cli/runtime/runtime-access-denied.test.ts
  • src/cli/runtime/runtime-access-denied.ts
  • src/cli/runtime/status.ts
  • src/cli/runtime/transport.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.

} catch (error) {
// Why: a denied read says nothing about whether Orca is running, so it must not read as absent.
throwIfAccessDenied(error)
return null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '1,130p' src/cli/runtime/metadata.ts
sed -n '1,130p' src/cli/runtime/status.ts
rg -n 'tryReadMetadata|readMetadata|runtime_unavailable|not_running' src/cli/runtime src/cli

Repository: stablyai/orca

Length of output: 16085


🏁 Script executed:

sed -n '1,115p' src/cli/runtime/metadata-access-denied.test.ts
sed -n '1,130p' src/cli/runtime/runtime-access-denied.ts
sed -n '110,165p' src/cli/runtime/status.test.ts
sed -n '195,245p' src/cli/runtime-client.test.ts
rg -n 'metadata|not_running|stale_bootstrap|ENOENT|ENOTDIR|ELOOP|ENAMETOOLONG' src/cli/runtime src/shared README.md docs --glob '!**/*.snap'

Repository: stablyai/orca

Length of output: 41898


🏁 Script executed:

sed -n '1,100p' src/cli/runtime/runtime-access-denied.ts

Repository: stablyai/orca

Length of output: 2422


Do not treat unexpected metadata read failures as absence.

When readFileSync() fails with ELOOP, ENAMETOOLONG, or another non-absence error, tryReadMetadata() returns null. getCliStatus() then reports not_running. Return null for ENOENT and ENOTDIR, preserve the existing malformed-JSON fallback, and propagate other read errors.

🐛 Suggested fix
   } catch (error) {
     // Why: a denied read says nothing about whether Orca is running, so it must not read as absent.
     throwIfAccessDenied(error)
-    return null
+    if (error instanceof SyntaxError) {
+      return null
+    }
+    if (
+      error instanceof Error &&
+      'code' in error &&
+      (error.code === 'ENOENT' || error.code === 'ENOTDIR')
+    ) {
+      return null
+    }
+    throw error
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return null
if (error instanceof SyntaxError) {
return null
}
if (
error instanceof Error &&
'code' in error &&
(error.code === 'ENOENT' || error.code === 'ENOTDIR')
) {
return null
}
throw error

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — reviewed the full diff at 0b11f50 (2 commits, 17 files) and verified the behavior, tests, and generated artifacts.

  • New runtime_access_denied classification (src/cli/runtime/runtime-access-denied.ts): an EPERM/EACCES from the metadata read or socket/pipe connect becomes one shared error carrying operation, systemCode, processState: 'unverifiable', retryable: false, optional pid/codexSandbox, and nextSteps. CODEX_SANDBOX only selects the wording; the errno decides classification.
  • Denied read no longer reads as absent (metadata.ts): both readMetadata and tryReadMetadata now throw the shared error on EPERM/EACCES. Missing/malformed metadata still maps to not_running, and the single caller (status.ts) handles the throw.
  • Denied connect reported as a denial, not a dead app (transport.ts): the connect 'error' handler maps EPERM/EACCES to the new error instead of runtime_unavailable; no request bytes are written.
  • Status refuses to guess (status.ts): getCliStatus rethrows the denial before the kill(pid, 0) probe, while preserving #20098's behavior for a refused/missing socket plus an EPERM/ESRCH pid probe.
  • orca open aborts before launching: openOrca calls getCliStatus() first, so a denial prevents a second app spawn.
  • Bundled skill guidance (skill-stubs/_shared/cli-resolution.md + 8 skills/*/SKILL.md, regenerated manifest and snapshot registry): tells agents to escalate rather than restart on this code.

Verification I ran at this head: pnpm tc:cli, check:code-quality:changed, oxfmt --check on the changed skill files, verify:bundled-skill-guides, and verify:skill-bundle-manifest all pass; the full src/cli suite is green (130 files, 1334 passed / 4 skipped). I also confirmed the tests can fail: reverting the three production files to base and removing the new module makes the new tests fail on the exact runtime_access_denied codes, the nextSteps text, and the starting vs stale_bootstrap discrimination. The author-disclosed caveats (Windows pipe path unit-tested with a faked errno only; intentional exit-code change for orca status) are reasonable, and I did not find anything actionable beyond them.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — reviewed the incremental delta at 8af3cb0 (the third commit, on top of the prior pullfrog review at 0b11f50), plus the full PR diff.

  • Narrowed the classification to the connect path: metadata.ts is reverted to main, so an EPERM/EACCES metadata read no longer becomes runtime_access_denied; only the socket/named-pipe connect errno decides. This keeps an unreadable user-data path reporting not_running (the Linux launch contract) rather than a denial.
  • Leaner shared error: runtime-access-denied.ts now exposes one runtimeAccessDeniedError(socketError) returning the error or null; data drops operation/pid/processState/retryable/codexSandbox (none are consumed anywhere under src), keeping systemCode and nextSteps. CODEX_SANDBOX still only picks the wording.
  • Transport and status unchanged in shape: transport.ts routes the connect 'error' through the helper; status.ts rethrows on the code before the kill(pid, 0) probe, so #20098's pid-probe behavior (starting / stale_bootstrap) is preserved.
  • Skill guidance trimmed: the shared CLI-resolution block and the 8 bundled guides say a denial means "escalate, don't restart"; the manifest and snapshot registry are regenerated.

Verification at this head: pnpm tc:cli passes, runtime-access-denied.test.ts + status.test.ts pass (18 tests), and both skill-generator verifies leave the tree clean. The dropped test cases are genuinely redundant — the generic non-Codex wording is asserted by the main EPERM/EACCES case, and the pid-probe starting/stale_bootstrap pins live in status.test.ts.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: d284544d-af24-41e6-bd2f-bd15c0f45893

📥 Commits

Reviewing files that changed from the base of the PR and between 0b11f50 and 8af3cb0.

📒 Files selected for processing (15)
  • resources/skills/current-manifest.json
  • resources/skills/snapshot-registry.json
  • skill-stubs/_shared/cli-resolution.md
  • skills/computer-use/SKILL.md
  • skills/linear-tickets/SKILL.md
  • skills/orca-cli/SKILL.md
  • skills/orca-emulator-android/SKILL.md
  • skills/orca-emulator/SKILL.md
  • skills/orca-linear/SKILL.md
  • skills/orca-per-workspace-env/SKILL.md
  • skills/orchestration/SKILL.md
  • src/cli/runtime/runtime-access-denied.test.ts
  • src/cli/runtime/runtime-access-denied.ts
  • src/cli/runtime/status.ts
  • src/cli/runtime/transport.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • skills/orca-emulator/SKILL.md
  • skills/orca-cli/SKILL.md
  • skills/orca-per-workspace-env/SKILL.md
  • skill-stubs/_shared/cli-resolution.md
  • skills/orchestration/SKILL.md
  • skills/orca-linear/SKILL.md
  • skills/linear-tickets/SKILL.md

Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Comment on lines +43 to +45
and retry. If it fails with `runtime_access_denied`, your sandbox blocked the connection:
re-run it with escalated permissions, and do not run `ORCA open` or restart Orca. If
`skills get` is unknown, explain that updating Orca restores the guide; use `--help` for

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '1,100p' src/cli/runtime/runtime-access-denied.ts
sed -n '20,40p' skill-stubs/_shared/cli-resolution.md
rg -n --hidden --glob '!node_modules' 'cli-resolution\.md|skill-stubs|runtime_access_denied' config scripts package.json skills | head -200

Repository: stablyai/orca

Length of output: 4990


🏁 Script executed:

sed -n '1,180p' skill-stubs/_shared/cli-resolution.md
printf '\n--- specific stubs and composition bindings ---\n'
cat -n skill-stubs/computer-use.md | sed -n '1,100p'
cat -n skill-stubs/orca-emulator-android.md | sed -n '1,100p'
sed -n '1,120p' config/scripts/skill-stub-composition.mjs
printf '\n--- generator source/projection paths ---\n'
sed -n '240,370p' config/scripts/generate-bundled-skill-guides.mjs
printf '\n--- relevant package scripts ---\n'
rg -n '"[^"]*(generate|skill)[^"]*"|generate-bundled-skill-guides' package.json config/scripts

Repository: stablyai/orca

Length of output: 35216


Describe runtime_access_denied as a connection-permission failure.

With CODEX_SANDBOX unset, EPERM or EACCES can indicate OS permissions, and the runtime provides an authorized-user recovery path. Both cited skills use this shared block. Update it and regenerate the skill guides with pnpm run generate:bundled-skill-guides.

🐛 Suggested fix
-If it fails with `runtime_access_denied`, your sandbox blocked the connection:
-re-run it with escalated permissions, and do not run `ORCA open` or restart Orca. If
+If it fails with `runtime_access_denied`, the sandbox or OS permissions denied the connection:
+re-run it outside the sandbox, or as a user allowed to reach Orca, and do not run `ORCA open` or restart Orca. If
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
and retry. If it fails with `runtime_access_denied`, your sandbox blocked the connection:
re-run it with escalated permissions, and do not run `ORCA open` or restart Orca. If
`skills get` is unknown, explain that updating Orca restores the guide; use `--help` for
and retry. If it fails with `runtime_access_denied`, the sandbox or OS permissions denied the connection:
re-run it outside the sandbox, or as a user allowed to reach Orca, and do not run `ORCA open` or restart Orca. If
`skills get` is unknown, explain that updating Orca restores the guide; use `--help` for

…ead 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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — reviewed the incremental delta at 9fdfb94 (commits 4–5, on top of the prior pullfrog review at 8af3cb0), plus the full PR diff.

  • A denied connect now checks pid liveness (src/cli/runtime/runtime-access-denied.ts, new runtime-pid-liveness.ts): runtimeAccessDeniedError returns null for EPERM/EACCES when isProcessRunning(metadata.pid) proves the pid gone (ESRCH), so a dead Orca's leftover socket falls through to the ordinary runtime_unavailable path and the existing "Orca is not running. Run 'orca open' first." advice. A live pid, or EPERM from the pid probe, keeps runtime_access_denied. isProcessRunning moves out of status.ts into the shared module.
  • status.ts re-throws the denial before its kill(pid, 0) fallback; the fallback still reports stale_bootstrap / starting per #20098.
  • Inlined the error code (9fdfb94): the exported RUNTIME_ACCESS_DENIED_CODE constant is gone and the literal is used at both sites, matching how other CLI error codes (selector_not_found, runtime_unavailable) are compared. runtimeAccessDeniedError now takes socketError: Error and reads code directly.
  • Tests (runtime-access-denied.test.ts): added the mockKill helper, turned the status case into it.each([undefined, 'EPERM']), and added a test pinning the dead-pid ESRCH path to not-running advice and stale_bootstrap.

Verification at this head: pnpm tc:cli passes; runtime-access-denied.test.ts (9) and status.test.ts (11) pass. I confirmed the dead-pid test would fail without the pid probe: without it, EPERM classifies as runtime_access_denied, so both the "Orca is not running" expectation and the stale_bootstrap resolution would fail. The inlining matches the repo's convention of comparing error-code string literals rather than importing constants, so I don't consider the removed export a regression.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit 9af6a3d into main Sep 23, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant