JSON-RPC filesystem.list fails #73
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_shrimp#73
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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-existentfilesystem.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.crates/hero_shrimp_web/ui/src/components/LibraryPage.tsxrpc("filesystem.list", { path, limit: 200 })rpc("filesystem.read", { path, max_bytes: ... })crates/hero_shrimp_server/src/rpc/methods/fs.rsfs.list_directory(line 16),fs.read_file(line 56). Nofilesystem.*method exists anywhere.rpc/jsonrpc/dispatch.rs) returnsmethod_not_foundfor unknown names;error.rsformats it as"Method not found: {method}"with code-32601— matching the issue text exactly.WorkContextBrowser.tsx:28already callsrpc("fs.list_directory", { path })successfully.Requirements
-32601.fs.list_directory,fs.read_file).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"filesystem.list"->"fs.list_directory""filesystem.read"->"fs.read_file"Dependencies: none
Step 2: Make size field mapping tolerant in LibraryPage.tsx
Files:
crates/hero_shrimp_web/ui/src/components/LibraryPage.tsxsize: 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) thennpm run buildinui/to regeneratestatic/assets.cargo buildso rust-embed re-embeds the updated assets.Dependencies: Steps 1-2
Acceptance Criteria
LibraryPage.tsxno longer referencesfilesystem.list/filesystem.read; usesfs.list_directory/fs.read_file.-32601error.fs.read_file.grep -rn "filesystem.list\|filesystem.read" crates/hero_shrimp_web/ui/srcreturns nothing.Notes
filesystem.*aliases is intentionally avoided — it enlarges the RPC/OpenRPC surface and creates two names for one operation.Test Results
cargo test --workspaceAll 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.
Implementation Summary
Fixed the
-32601 Method not found: filesystem.listerror 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 asfs.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.tsxfilesystem.list->fs.list_directoryfilesystem.read->fs.read_filee.size_bytes ?? e.size), consistent with WorkContextBrowser.npm run build) — the oldfilesystem.liststring is gone from the embedded artifact andfs.list_directory/fs.read_fileare now present (crates/hero_shrimp_web/static/assets/app.*.js).hero_shrimp_webso rust-embed re-embeds the updated assets.Verification
grep -rn "filesystem.list|filesystem.read" crates/hero_shrimp_web/ui/srcreturns nothing.filesystem.list/filesystem.read; containsfs.list_directoryandfs.read_file.cargo test --workspace: 2684 passed, 0 failed, 18 ignored.Notes
fs.list_directoryname.Implementation Summary
Changes Made
The Library -> Workspaces file browser called JSON-RPC methods (
filesystem.list/filesystem.read) that the backend does not register, producingMethod 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.tsxloadDir:filesystem.list->fs.list_directoryloadFile:filesystem.read->fs.read_filesize: e.size_bytes ?? e.sizecrates/hero_shrimp_web/static/assets/app.DrkILYkN.jsreplacesapp.CgWRa9bF.js;static/index.htmlupdated) and recompiledhero_shrimp_webso the rust-embed-served assets reflect the fix.Verification
grep -rn "filesystem.list\|filesystem.read" crates/hero_shrimp_web/ui/srcreturns nothing.filesystem.list/filesystem.readstrings; it containsfs.list_directoryandfs.read_file.cargo build -p hero_shrimp_webcompiles cleanly.Test Results
cargo test -p hero_shrimp_web -p hero_shrimp_server): 289 passed, 0 failed, 0 ignored.LibraryPage.tsxintroduces no new type errors (pre-existing tsc warnings in other components are unrelated to this change).Notes