feat(desktop): browse remote backend files - #43434
Conversation
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-import |
2 |
First entries
tests/hermes_cli/test_web_server_fs.py:9: [unresolved-import] unresolved-import: Cannot resolve imported module `starlette.testclient`
tests/hermes_cli/test_web_server_fs.py:4: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
✅ Fixed issues: none
Unchanged: 5598 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
|
Reviewed by Hermes Agent — deferred to maintainer for product sign-off. Feature PRs ( Hermes Agent triage |
|
Reviewed the code. The fix is real and well scoped. #42878 is a genuine bug: the Files panel read backend Backend tests pass (13/13). Whitespace is clean, i18n landed in all four locales, and the One design decision worth calling out explicitly
So the codebase already takes a defense-in-depth stance for authenticated clients, and these endpoints don't follow it. This is probably fine anyway: the same server already exposes It still deserves a conscious decision because the endpoints are registered unconditionally, so the web dashboard gets them as well, not just desktop-remote. If you'd rather scope the browser to the workspace subtree (or reuse the media-roots model), now is the cheap time to decide. My lean is that it's acceptable given the terminal precedent, but it deserves one sentence of explicit sign-off. Minor, non-blocking
TestsBehavior and invariant style, not snapshots. Coverage is solid: sorting plus noise-hiding, relative paths, structured ENOENT, truncation, source-cap 413, binary detection, data-url cap, git-root (nested and outside), default-cwd preference and fallback, and auth. I didn't run the 39 desktop vitest specs (no |
Summary
Desktop remote sessions already carry a backend
cwd, but the Files panel still read through Electron's local filesystem IPC. Backend paths were therefore resolved on the client machine, so remote-backed Desktop sessions could show unreadable folders and could not preview backend-only files.This routes the Files surface by connection mode:
window.hermesDesktop.api, matching the existing Desktop remote connection model.The backend slice is read-only: directory listing, capped text previews, capped data URLs, git-root detection, and backend default cwd under
/api/fs/*. It does not add terminal access, PTYs, SSH/SFTP, uploads, writes, deletes, mkdir, rename, chmod, or sync.Also in here
.gitignore+ git-root support — existing filtering behavior is preserved, with caches keyed by connection identity so the same path on two backends does not share stale rules.dataUrlwhen one was already provided by the caller.Fixes #42878.
Test plan
scripts/run_tests.sh tests/hermes_cli/test_web_server_fs.py— 13 passedcd apps/desktop && npm run test:ui -- src/store/session.test.ts src/lib/desktop-fs.test.ts src/app/right-sidebar/files/use-project-tree.test.ts src/lib/preview-targets.test.ts src/app/chat/right-rail/preview-pane.test.tsx— 39 passedcd apps/desktop && npm run type-check— cleangit diff --check— clean/api/fs/*auth, list, default-cwd, and text preview work from a remote Desktop client.Follow-up notes
The integrated terminal is intentionally unchanged here. Remote terminal behavior belongs to the separate remote terminal work; this PR only makes the Files browser/preview use the active backend filesystem in remote mode.