Repository navigation
fix(cli): explain SIGABRT serve exits instead of naming the signal - #10464
Conversation
…10461) `orca serve` reported only "Orca serve exited via SIGABRT", which sent a P0 investigation down a code-signature path while a diagnostic crash report sat unread on disk. On darwin + SIGABRT the signal-exit path now names the macOS application-startup abort, its usual sandbox/SSH/CI causes, and points at ~/Library/Logs/DiagnosticReports/Orca-*.ips via the existing nextSteps channel. Other platforms and signals get a clear message with no invented cause.
📝 WalkthroughWalkthroughAdds 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 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 |
|
Implemented via Orca orchestration (task |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 28fcdec7-2825-4ff2-8195-c361f101c4e6
📒 Files selected for processing (3)
src/cli/runtime/serve-signal-exit-diagnostic.test.tssrc/cli/runtime/serve-signal-exit-diagnostic.tssrc/cli/runtime/serve-update-supervisor.ts
| // Why: the startup abort happens inside +[NSApplication sharedApplication], before any of our JS | ||
| // runs, so the parent CLI is the only place it can be explained. We only see the signal, never the | ||
| // phase, so the cause is offered as the likely one rather than asserted. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep this rationale to one concise sentence.
The three-line implementation narrative exceeds the comment guideline; retain only the non-obvious limitation, such as that SIGABRT alone cannot establish the failure phase. As per coding guidelines, comments must be concise, limited to non-obvious information, and preferably one line.
Source: Coding guidelines
…tablyai#10464) * fix(cli): explain SIGABRT serve exits instead of naming the signal (stablyai#10461) `orca serve` reported only "Orca serve exited via SIGABRT", which sent a P0 investigation down a code-signature path while a diagnostic crash report sat unread on disk. On darwin + SIGABRT the signal-exit path now names the macOS application-startup abort, its usual sandbox/SSH/CI causes, and points at ~/Library/Logs/DiagnosticReports/Orca-*.ips via the existing nextSteps channel. Other platforms and signals get a clear message with no invented cause. * fix(cli): stop asserting the SIGABRT exit happened at startup * fix(cli): stop steering macOS SIGABRT users away from SSH serve
Fixes #10461.
Problem
When
orca servedied from a signal, the CLI reported only:No cause, no next step, no pointer to where a crash report lives.
This is not cosmetic. In #9282 it was the only signal a user had, and it sent a P0 investigation down the wrong path — a suspected code-signature / ASAR corruption defect, including a PR that was written and then closed — for what turned out to be an environmental failure. The information needed to diagnose it correctly was on the machine the whole time: macOS had written
~/Library/Logs/DiagnosticReports/Orca-*.ipsnaming the crashing frame, and Electron had printedtask_name_for_pid: (os/kern) failure (5)to stderr. Neither surfaced through our CLI.The actual crash was an abort during macOS application registration, before any of our JS runs:
Because there's no JS on the stack, this can't be caught in-process — the parent CLI is the only place it can be explained.
Fix
Extracts a pure
serveSignalExitError(signal, platform)builder and swaps the bare throw insuperviseForegroundServefor it:~/Library/Logs/DiagnosticReports/Orca-*.ipspointer throughRuntimeClientError's existingdata.nextStepschannel, whichformat.tsalready renders in both human and--jsonoutput. The parent only ever observes the signal, never the phase, so the cause is offered as likely rather than asserted.exited via <SIGNAL>.with no invented cause.exited via null.Verbatim human output on darwin + SIGABRT:
The remedy deliberately does not tell users to stop serving over SSH — SSH serve is supported; what it needs is an active macOS desktop login for the window-server connection.
Scope
Tier 1 from the issue only. Deliberately excluded:
launch.tsspawns withstdio: 'inherit', so the parent can't observe child stderr without rewiring the pass-through path. Deferred until this recurs.crashReporter.start()— Orca collects no crash data of its own today. That's the systemic version of this problem and needs its own issue (consent, privacy, an endpoint).Test plan
superviseForegroundServeend-to-end (darwin SIGABRT throws the diagnostic, linux SIGABRT doesn't, numeric exits0/7return unchanged).vitest src/cli/runtime→ 63 passed across 9 files.vitest src/cli→ 511 passed across 39 files.typecheck:cli+typecheck:nodeclean; oxlint clean on touched files; max-lines ratchet OK.