Skip to content

feat(desktop): browse remote backend files (salvage #43434)#44326

Merged
teknium1 merged 5 commits into
mainfrom
hermes/hermes-a1a7d460
Jun 11, 2026
Merged

feat(desktop): browse remote backend files (salvage #43434)#44326
teknium1 merged 5 commits into
mainfrom
hermes/hermes-a1a7d460

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Salvage of #43434 by @yoniebans onto current main: the Desktop Files panel now routes by connection mode — local keeps Electron filesystem IPC, remote uses authenticated read-only /api/fs/* backend REST, so remote-backed Desktop sessions can browse and preview backend files instead of resolving paths on the client machine.

Fixes #42878.

Changes

  • hermes_cli/web_server.py: read-only /api/fs/{list,read-text,read-data-url,git-root,default-cwd} endpoints (auth-gated, size-capped, binary sniffing)
  • apps/desktop/src/lib/desktop-fs.ts: routing facade — local IPC vs window.hermesDesktop.api
  • Connection-keyed remote cwd memory, gitignore/git-root caches, in-app remote folder picker, no local watcher on remote previews
  • i18n strings (en/ja/zh/zh-hant)

Salvage notes

  • Original branch was 106 commits behind and DIRTY. Cherry-picked all 5 commits with authorship preserved (rebase-merge this PR).
  • web_server.py conflict: the managed-files (/api/files) block landed after branch point; resolved keeping main's block plus the PR's /api/fs/* block.
  • use-project-tree.test.ts conflict: kept main's error-placeholder expectations (fix(desktop): Harden local file tree paths #43618) plus the PR's per-connection gitignore cache test.

Validation

Check Result
scripts/run_tests.sh tests/hermes_cli/test_web_server_fs.py 13/13 pass
desktop vitest (5 files) 41/41 pass
npm run typecheck clean
E2E (TestClient, temp HERMES_HOME) auth 401, list/hide-dirs, ENOENT shape, text+binary preview, dir-400, data-url, git-root, default-cwd, NUL-reject, /dev/null-reject — all pass
ruff on web_server.py clean

Original PR's shard-5 CI failure was an infra flake (splitter re-invoked pytest on a checkout missing the new test file); all 4617 tests had passed.

Infographic

desktop-remote-fs

@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-a1a7d460 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 10719 on HEAD, 10717 on base (🆕 +2)

🆕 New issues (2):

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: 5609 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Desktop file browser shows 'unreadable' (ENOENT) when connected to remote gateway — reads server cwd on local filesystem

3 participants