-
Notifications
You must be signed in to change notification settings - Fork 98
WASM shell tools cannot read VFS files, including files created by the shell itself #1432
Description
Title: WASM shell tools cannot read files from agentOS VFS, including files created by the shell itself
Summary
Using @rivet-dev/agent-os-core with @rivet-dev/agent-os-common, WASM shell tools like cat, grep, and sha256sum fail with Permission denied when reading:
- files written via
vm.writeFile(...), and - files created by the WASM shell itself.
This reproduces without Pi, LLM credentials, or any app-specific code.
Repro
Standalone repro gist:
Files in the gist:
package.jsonrepro.mjs
Package versions:
@rivet-dev/agent-os-core@0.1.1@rivet-dev/agent-os-common@0.0.260331072558
Run:
npm install
npm run reproNode version used locally:
v24.14.1 (linux x64)Expected
cat,grep, andsha256sumshould be able to read files in the VM filesystem.- This should work both for host-written files (
vm.writeFile) and shell-created files.
Actual
All of these return nonzero with Permission denied, for example:
WARN could not retrieve pid for child process
grep: /mnt/scratch/input/host-written.txt: Permission denied (os error 2)
WARN could not retrieve pid for child process
cat: /tmp/wasm-shell-cat.txt: Permission denied
WARN could not retrieve pid for child process
sha256sum: /tmp/wasm-shell-sha.txt: Permission denied
The file metadata appears normal from the host API. For the host-written file, vm.stat() returned:
{
"mode": 33188,
"size": 36,
"isDirectory": false,
"isSymbolicLink": false,
"atimeMs": 1775333947328,
"mtimeMs": 1775333947328,
"ctimeMs": 1775333947328,
"birthtimeMs": 1775333947328,
"ino": 3,
"nlink": 1,
"uid": 0,
"gid": 0
}mode: 33188 is 0100644, so the host API sees a normal world-readable file.
Notes
AgentOs.create()appears to default host kernel permissions toallowAll.- The failure also reproduces via direct
vm.exec(...), outside agent sessions. - Every
vm.exec()call emitsWARN could not retrieve pid for child processon stderr before any command output. This may be a related symptom or diagnostic clue. - There is an errno inconsistency in the failures:
grepreportsPermission denied (os error 2)whereos error 2isENOENT, whilecatandsha256sumreport plainPermission denied. That may help narrow down whether this is happening in the WASI/VFS layer. - This makes it look like a VFS/WASM-shell integration bug or limitation rather than session approval config.
Question
Is there a missing filesystem permission or mount configuration needed for WASM commands to read VFS files, or is this a bug?