JSON-RPC filesystem.list fails #73

Closed
opened 2026-06-02 07:59:22 +00:00 by rawan · 4 comments
Member

filesystem.list JSON-RPC Method Not Found
Both the "browse files" panel in chat and Library → Workspaces show empty folder / error: JSON-RPC filesystem.list failed: Method not found: filesystem.list (-32601). Files written by the agent are completely inaccessible from the UI file browser. This is broken across the board.

image

filesystem.list JSON-RPC Method Not Found Both the "browse files" panel in chat and Library → Workspaces show empty folder / error: JSON-RPC filesystem.list failed: Method not found: filesystem.list (-32601). Files written by the agent are completely inaccessible from the UI file browser. This is broken across the board. ![image](/attachments/1a8e38f9-2c84-47c8-bc72-83f7326e9aca)
Author
Member

Implementation Spec for Issue #73

Objective

Make the UI file browsers (Library -> Workspaces tab, and the in-chat work-context file browser) successfully list and read files written by the agent. The fix is to call the JSON-RPC method names the backend actually registers (fs.list_directory / fs.read_file) instead of the non-existent filesystem.list / filesystem.read.

Root Cause

The frontend calls method names that are never registered on the backend, so the JSON-RPC dispatcher returns -32601 Method not found.

  • Frontend (broken): crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx
    • Line 855: rpc("filesystem.list", { path, limit: 200 })
    • Line 885: rpc("filesystem.read", { path, max_bytes: ... })
  • Backend registered names: crates/hero_shrimp_server/src/rpc/methods/fs.rs
    • fs.list_directory (line 16), fs.read_file (line 56). No filesystem.* method exists anywhere.
  • The dispatcher (rpc/jsonrpc/dispatch.rs) returns method_not_found for unknown names; error.rs formats it as "Method not found: {method}" with code -32601 — matching the issue text exactly.
  • Confirmation the correct name works: WorkContextBrowser.tsx:28 already calls rpc("fs.list_directory", { path }) successfully.

Requirements

  • Library -> Workspaces tab lists entries and reads file previews without -32601.
  • Frontend method names match backend registrations exactly (fs.list_directory, fs.read_file).
  • The shipped/embedded UI bundle must reflect the source change (Vite rebuild + cargo recompile, since the UI is embedded via rust-embed at compile time).
  • No backend RPC surface change required.

Files to Modify

  • crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx — rename the two RPC method strings and fix the doc comment; make size field mapping tolerant.
  • crates/hero_shrimp_web/ui/src/components/WorkContextBrowser.tsx — verification/robustness only (method name already correct).
  • crates/hero_shrimp_web/static/* — regenerated by the Vite build (not hand-edited).

Implementation Plan

Step 1: Rename RPC method calls in LibraryPage.tsx

Files: crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx

  • Line 855: "filesystem.list" -> "fs.list_directory"
  • Line 885: "filesystem.read" -> "fs.read_file"
  • Lines 812-813 doc comment: update method names accordingly.
    Dependencies: none

Step 2: Make size field mapping tolerant in LibraryPage.tsx

Files: crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx

  • Line 860: size: e.size_bytes -> size: e.size_bytes ?? e.size (consistent with WorkContextBrowser.tsx:31).
    Dependencies: same file as Step 1

Step 3: Rebuild UI bundle and recompile web crate

Files: crates/hero_shrimp_web/ui (build), crates/hero_shrimp_web (compile)

  • npm install (if needed) then npm run build in ui/ to regenerate static/ assets.
  • cargo build so rust-embed re-embeds the updated assets.
    Dependencies: Steps 1-2

Acceptance Criteria

  • LibraryPage.tsx no longer references filesystem.list / filesystem.read; uses fs.list_directory / fs.read_file.
  • Library -> Workspaces tab lists files/directories with no -32601 error.
  • Clicking a file shows a content preview via fs.read_file.
  • In-chat work-context file browser lists files from the active context root.
  • grep -rn "filesystem.list\|filesystem.read" crates/hero_shrimp_web/ui/src returns nothing.

Notes

  • Minimal, lowest-risk fix is the frontend rename + rebuild. Adding backend filesystem.* aliases is intentionally avoided — it enlarges the RPC/OpenRPC surface and creates two names for one operation.
  • Build/recompile is mandatory: the UI is embedded via rust-embed at compile time, so a source edit alone does not reach the running daemon.
## Implementation Spec for Issue #73 ### Objective Make the UI file browsers (Library -> Workspaces tab, and the in-chat work-context file browser) successfully list and read files written by the agent. The fix is to call the JSON-RPC method names the backend actually registers (`fs.list_directory` / `fs.read_file`) instead of the non-existent `filesystem.list` / `filesystem.read`. ### Root Cause The frontend calls method names that are never registered on the backend, so the JSON-RPC dispatcher returns `-32601 Method not found`. - Frontend (broken): `crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx` - Line 855: `rpc("filesystem.list", { path, limit: 200 })` - Line 885: `rpc("filesystem.read", { path, max_bytes: ... })` - Backend registered names: `crates/hero_shrimp_server/src/rpc/methods/fs.rs` - `fs.list_directory` (line 16), `fs.read_file` (line 56). No `filesystem.*` method exists anywhere. - The dispatcher (`rpc/jsonrpc/dispatch.rs`) returns `method_not_found` for unknown names; `error.rs` formats it as `"Method not found: {method}"` with code `-32601` — matching the issue text exactly. - Confirmation the correct name works: `WorkContextBrowser.tsx:28` already calls `rpc("fs.list_directory", { path })` successfully. ### Requirements - Library -> Workspaces tab lists entries and reads file previews without `-32601`. - Frontend method names match backend registrations exactly (`fs.list_directory`, `fs.read_file`). - The shipped/embedded UI bundle must reflect the source change (Vite rebuild + cargo recompile, since the UI is embedded via rust-embed at compile time). - No backend RPC surface change required. ### Files to Modify - `crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx` — rename the two RPC method strings and fix the doc comment; make size field mapping tolerant. - `crates/hero_shrimp_web/ui/src/components/WorkContextBrowser.tsx` — verification/robustness only (method name already correct). - `crates/hero_shrimp_web/static/*` — regenerated by the Vite build (not hand-edited). ### Implementation Plan #### Step 1: Rename RPC method calls in LibraryPage.tsx Files: `crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx` - Line 855: `"filesystem.list"` -> `"fs.list_directory"` - Line 885: `"filesystem.read"` -> `"fs.read_file"` - Lines 812-813 doc comment: update method names accordingly. Dependencies: none #### Step 2: Make size field mapping tolerant in LibraryPage.tsx Files: `crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx` - Line 860: `size: e.size_bytes` -> `size: e.size_bytes ?? e.size` (consistent with WorkContextBrowser.tsx:31). Dependencies: same file as Step 1 #### Step 3: Rebuild UI bundle and recompile web crate Files: `crates/hero_shrimp_web/ui` (build), `crates/hero_shrimp_web` (compile) - `npm install` (if needed) then `npm run build` in `ui/` to regenerate `static/` assets. - `cargo build` so rust-embed re-embeds the updated assets. Dependencies: Steps 1-2 ### Acceptance Criteria - [ ] `LibraryPage.tsx` no longer references `filesystem.list` / `filesystem.read`; uses `fs.list_directory` / `fs.read_file`. - [ ] Library -> Workspaces tab lists files/directories with no `-32601` error. - [ ] Clicking a file shows a content preview via `fs.read_file`. - [ ] In-chat work-context file browser lists files from the active context root. - [ ] `grep -rn "filesystem.list\|filesystem.read" crates/hero_shrimp_web/ui/src` returns nothing. ### Notes - Minimal, lowest-risk fix is the frontend rename + rebuild. Adding backend `filesystem.*` aliases is intentionally avoided — it enlarges the RPC/OpenRPC surface and creates two names for one operation. - Build/recompile is mandatory: the UI is embedded via rust-embed at compile time, so a source edit alone does not reach the running daemon.
Author
Member

Test Results

  • Command: cargo test --workspace
  • Total: 2684
  • Passed: 2684
  • Failed: 0

All tests passed. (18 tests ignored by attribute, not counted as failures.) Verified across the full Rust workspace including hero_shrimp_engine (1648), hero_shrimp_runtime (559), hero_shrimp_server (289), admin_endpoints (49), and all other crate/integration/doc test binaries. The hero_shrimp_web crate compiles and its test binaries run clean.

## Test Results - Command: `cargo test --workspace` - Total: 2684 - Passed: 2684 - Failed: 0 All tests passed. (18 tests ignored by attribute, not counted as failures.) Verified across the full Rust workspace including hero_shrimp_engine (1648), hero_shrimp_runtime (559), hero_shrimp_server (289), admin_endpoints (49), and all other crate/integration/doc test binaries. The hero_shrimp_web crate compiles and its test binaries run clean.
Author
Member

Implementation Summary

Fixed the -32601 Method not found: filesystem.list error in the UI file browsers.

Root cause

The Workspaces file browser called JSON-RPC methods filesystem.list / filesystem.read, which are not registered on the backend. The backend registers these operations as fs.list_directory / fs.read_file (crates/hero_shrimp_server/src/rpc/methods/fs.rs), so the dispatcher returned -32601.

Changes

  • crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx
    • filesystem.list -> fs.list_directory
    • filesystem.read -> fs.read_file
    • Made the directory-entry size mapping tolerant (e.size_bytes ?? e.size), consistent with WorkContextBrowser.
    • Updated the doc comment to reference the correct method names.
  • Rebuilt the UI bundle (npm run build) — the old filesystem.list string is gone from the embedded artifact and fs.list_directory / fs.read_file are now present (crates/hero_shrimp_web/static/assets/app.*.js).
  • Recompiled hero_shrimp_web so rust-embed re-embeds the updated assets.

Verification

  • grep -rn "filesystem.list|filesystem.read" crates/hero_shrimp_web/ui/src returns nothing.
  • Built bundle no longer contains filesystem.list / filesystem.read; contains fs.list_directory and fs.read_file.
  • cargo test --workspace: 2684 passed, 0 failed, 18 ignored.

Notes

  • No backend RPC surface change was needed; the in-chat WorkContextBrowser already used the correct fs.list_directory name.
## Implementation Summary Fixed the `-32601 Method not found: filesystem.list` error in the UI file browsers. ### Root cause The Workspaces file browser called JSON-RPC methods `filesystem.list` / `filesystem.read`, which are not registered on the backend. The backend registers these operations as `fs.list_directory` / `fs.read_file` (`crates/hero_shrimp_server/src/rpc/methods/fs.rs`), so the dispatcher returned `-32601`. ### Changes - `crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx` - `filesystem.list` -> `fs.list_directory` - `filesystem.read` -> `fs.read_file` - Made the directory-entry size mapping tolerant (`e.size_bytes ?? e.size`), consistent with WorkContextBrowser. - Updated the doc comment to reference the correct method names. - Rebuilt the UI bundle (`npm run build`) — the old `filesystem.list` string is gone from the embedded artifact and `fs.list_directory` / `fs.read_file` are now present (`crates/hero_shrimp_web/static/assets/app.*.js`). - Recompiled `hero_shrimp_web` so rust-embed re-embeds the updated assets. ### Verification - `grep -rn "filesystem.list|filesystem.read" crates/hero_shrimp_web/ui/src` returns nothing. - Built bundle no longer contains `filesystem.list` / `filesystem.read`; contains `fs.list_directory` and `fs.read_file`. - `cargo test --workspace`: 2684 passed, 0 failed, 18 ignored. ### Notes - No backend RPC surface change was needed; the in-chat WorkContextBrowser already used the correct `fs.list_directory` name.
Author
Member

Implementation Summary

Changes Made

The Library -> Workspaces file browser called JSON-RPC methods (filesystem.list / filesystem.read) that the backend does not register, producing Method not found (-32601). Renamed the calls to the methods the backend actually registers (fs.list_directory / fs.read_file).

Files modified:

  • crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx
    • loadDir: filesystem.list -> fs.list_directory
    • loadFile: filesystem.read -> fs.read_file
    • Updated the doc comment listing the RPCs used
    • Made the directory entry size mapping tolerant: size: e.size_bytes ?? e.size
  • Rebuilt the Vite UI bundle (crates/hero_shrimp_web/static/assets/app.DrkILYkN.js replaces app.CgWRa9bF.js; static/index.html updated) and recompiled hero_shrimp_web so the rust-embed-served assets reflect the fix.

Verification

  • grep -rn "filesystem.list\|filesystem.read" crates/hero_shrimp_web/ui/src returns nothing.
  • The built bundle contains no filesystem.list / filesystem.read strings; it contains fs.list_directory and fs.read_file.
  • cargo build -p hero_shrimp_web compiles cleanly.

Test Results

  • Rust (cargo test -p hero_shrimp_web -p hero_shrimp_server): 289 passed, 0 failed, 0 ignored.
  • TypeScript: the production Vite build succeeds; LibraryPage.tsx introduces no new type errors (pre-existing tsc warnings in other components are unrelated to this change).

Notes

  • No backend RPC surface change was needed; the fix aligns the frontend with existing method names.
## Implementation Summary ### Changes Made The Library -> Workspaces file browser called JSON-RPC methods (`filesystem.list` / `filesystem.read`) that the backend does not register, producing `Method not found (-32601)`. Renamed the calls to the methods the backend actually registers (`fs.list_directory` / `fs.read_file`). Files modified: - `crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx` - `loadDir`: `filesystem.list` -> `fs.list_directory` - `loadFile`: `filesystem.read` -> `fs.read_file` - Updated the doc comment listing the RPCs used - Made the directory entry size mapping tolerant: `size: e.size_bytes ?? e.size` - Rebuilt the Vite UI bundle (`crates/hero_shrimp_web/static/assets/app.DrkILYkN.js` replaces `app.CgWRa9bF.js`; `static/index.html` updated) and recompiled `hero_shrimp_web` so the rust-embed-served assets reflect the fix. ### Verification - `grep -rn "filesystem.list\|filesystem.read" crates/hero_shrimp_web/ui/src` returns nothing. - The built bundle contains no `filesystem.list` / `filesystem.read` strings; it contains `fs.list_directory` and `fs.read_file`. - `cargo build -p hero_shrimp_web` compiles cleanly. ### Test Results - Rust (`cargo test -p hero_shrimp_web -p hero_shrimp_server`): 289 passed, 0 failed, 0 ignored. - TypeScript: the production Vite build succeeds; `LibraryPage.tsx` introduces no new type errors (pre-existing tsc warnings in other components are unrelated to this change). ### Notes - No backend RPC surface change was needed; the fix aligns the frontend with existing method names.
rawan self-assigned this 2026-06-02 11:30:35 +00:00
rawan closed this issue 2026-06-02 12:17:41 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_shrimp#73
No description provided.