Repository navigation
fix(cli): orca file open opens PDFs and other binaries like the File Explorer - #24445
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughMobile binary files now pass through existence validation and are sent to the editor host. The CLI file open handler now reports a runtime response with Priority: ⬇️ Low Merge Risk: 🔵 Low · up to File diff can incorrectly say it opened an editor when it did not. Restore the declined-open message; this is a bounded reporting issue rather than a failure to return diff data. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change retains existing file-access checks and editor routing. No introduced security flaw was established, but end-to-end binary viewing, particularly for remote files, remains incompletely verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
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: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 50e71ce9-21d0-4b71-99b4-48adae643c93
📒 Files selected for processing (4)
src/cli/handlers/file.test.tssrc/cli/handlers/file.tssrc/main/runtime/orca-runtime-files-mobile-explorer-reads.test.tssrc/main/runtime/runtime-file-commands-constructor.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
There was a problem hiding this comment.
ℹ️ No critical issues — one minor consistency question inline.
Reviewed changes
- Binaries now open on the host:
RuntimeFileCommands.openMobileFiledrops the mobile-preview gate, so PDFs, ZIPs, and other binaries open in the desktop editor and returnopened:true;kindbecomes description-only. orca file openfails loudly: the handler throwsfile_not_opened(exit 1,ok:falsein--json) when an older host still declines the file, carrying an "update the app" next step.- Failure copy trimmed:
formatFileOpen/formatFileDiffno longer render their "Did not open…" branches. - Tests: an unopened
file openassertsok:false+ exit 1; PDF/ZIP opens and a missing-binary ENOENT rejection cover the runtime change.
The "like the File Explorer" parity claim holds by construction — both routes call store.openFile(mode:'edit'), and the editor renders PDFs via ImageViewer/PdfViewer and other binaries as "Binary file — cannot display". The host-side wire change is safe for old paired clients, which already handle both opened values.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…Explorer (STA-9113) files.open gated the desktop open on the mobile client's preview list, so PDFs returned opened:false with ok:true. The host now always opens (after the existence check); the CLI fails loudly if an older host still declines. Co-Authored-By: Claude <[email protected]>
file diff returns data regardless of whether the file can be opened in the editor. The check is only necessary for file open, which is a direct user request to open a file.
Apply unopened-file validation to `file diff` command to prevent binaries from silently succeeding, matching `file open` behavior. Reject directory opens in mobile file operations. Extract common file-open validation.
f675b2e to
72328f2
Compare

Fixes #24328
Problem
orca file openon PDFs and binary files would exit 0 and print "Opened..." even though the Orca app declined the file. Older versions returnopened:falsefor binaries, but the CLI treated it as success and silently failed.Solution
The CLI now fails with
ok:falseand exit code 1 when a file open returnsopened:false. The mobile runtime was also updated to stop blocking binaries—now PDFs, ZIPs, and other binaries open through the desktop editor, matching the File Explorer.What Changed
orca file openerrors if the app declines a file instead of silently succeedingopened:falseand that binaries now open successfullyWhy
When a CLI command fails silently, users can't tell what went wrong. By failing loudly with a helpful error message, users know to update their Orca app, which now opens every file type the File Explorer does.
Testing
opened:falsecauses exit code 1 andok:falsein JSON modeChecklist
pnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)