Fix remote File Explorer opening files via local fs:readFile#6506
Fix remote File Explorer opening files via local fs:readFile#6506utkarshparekh wants to merge 2 commits into
Conversation
Pass the worktree runtime owner when opening files from File Explorer so editor tabs use runtime RPC instead of falling back to local file reads. Fixes stablyai#6440
📝 WalkthroughWalkthrough
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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
Run ID: 3520dbb7-25e5-43b1-b1fa-3f64bd854010
📒 Files selected for processing (5)
src/renderer/src/components/right-sidebar/FileExplorer.tsxsrc/renderer/src/components/right-sidebar/file-explorer-drag-scroll-marker.test.tsxsrc/renderer/src/components/right-sidebar/useFileExplorerHandlers.test.tssrc/renderer/src/components/right-sidebar/useFileExplorerHandlers.tssrc/renderer/src/components/right-sidebar/useFileExplorerInlineInput.ts
Document the suppressActiveRuntimeFallback contract and treat blank runtime IDs as no owner when opening newly created explorer files.
1740e86 to
801d951
Compare
|
ready for review |
Pass the worktree runtime owner when opening files from File Explorer so editor tabs use runtime RPC instead of falling back to local file reads.
Fixes #6440
Summary
When opening a file from a paired remote runtime's File Explorer, the editor tab was created without
runtimeEnvironmentId. Reads then fell back to localfs:readFile, which failed with "Access denied: path resolves outside allowed directories." Retry hit the same path.This change passes the worktree's runtime owner when opening files from File Explorer (click and inline create), matching existing patterns in drag-and-drop and mobile file open. Editor tabs now route through runtime file RPC, and Retry uses the same owner.
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm test— targeted tests for changed files pass (useFileExplorerHandlers.test.ts,file-explorer-drag-scroll-marker.test.tsx, 9 tests). Full suite not re-run locally on Node 26.pnpm build— not run locally yet; CI will verify.Manual repro (from #6440):
large.binorREADME.md).Unable to load filewith localfs:readFileaccess denied; Retry repeated the failure.AI Review Report
Reviewed with Cursor agent against
CONTRIBUTING.mdandAGENTS.md.Risks checked:
runtimeEnvironmentId: nullwithsuppressActiveRuntimeFallback: true, preserving explicit local reads.openFilecalls; no new watchers or polling.Flags / verification:
useGlobalFileDrop/ mobileonOpenFileFromMobilepattern for runtime owner propagation.useFileExplorerInlineInput.ts(same missing owner).search-match-open.ts) — separate code path, out of scope for Remote runtime File Explorer open/retry can fall back to local fs:readFile #6440.Security Audit
Reviewed areas:
runtimeEnvironmentIdis set, instead of incorrectly hitting localfs:readFile. Reduces risk of confusing cross-boundary reads rather than expanding access.Follow-up: None identified for this change.
Notes
search-match-open.ts) may have the same class of bug; can follow up separately if desired.