Skip to content

fix(runtime-core): preserve u64 stat identity fields as bigint#1652

Open
NathanFlurry wants to merge 1 commit into
mainfrom
stat-dev
Open

fix(runtime-core): preserve u64 stat identity fields as bigint#1652
NathanFlurry wants to merge 1 commit into
mainfrom
stat-dev

Conversation

@NathanFlurry

Copy link
Copy Markdown
Member
  • Keeps the protocol u64 stat fields (dev, rdev, ino, size, blocks, nlink) as bigint in LiveGuestFilesystemStat instead of throwing when a host filesystem reports values above Number.MAX_SAFE_INTEGER.
  • Narrows to plain numbers only at the numeric VirtualStat boundaries (kernel proxy, rpc client, browser fs bridge), matching Node's default lossy fs.stat behavior.
  • Brings the TS client stat shape in line with the Rust client, which already carries these fields as u64.
  • Adds regression coverage for stat identity fields above the JS safe integer range.

Fixes the guest filesystem stat dev exceeds JavaScript safe integer range crash seen when walking host-mounted skills directories.

🤖 Generated with Claude Code

@railway-app

railway-app Bot commented Jul 7, 2026

Copy link
Copy Markdown

🚅 Deployed to the agentos-pr-1652 environment in agentos

Service Status Web Updated (UTC)
agentos 😴 Sleeping (View Logs) Web Jul 7, 2026 at 11:00 pm

🚅 Environment agentos-pr-1652 in rivet-frontend has no services deployed.

Copy link
Copy Markdown
Member Author

Follow-up u64 narrowing audit fixes are pushed on stat-dev (aa35d976):

  • Fixed WASI fd_pread/fd_pwrite positioned I/O offsets above 4 GiB by dropping the wasm32 >>> 0 truncation and adding the same finite/non-negative guard used by seek.
  • Preserved exact bigint ino/size/nlink values through the stat-to-WASI filestat path while keeping the public VirtualStat number fields Node-compatible.
  • Kept guest directory entry size as bigint in live response payloads, narrowing only at the public recursive-listing boundary.
  • Converted stat timestamps with lossy Number(...) so far-future guest timestamps do not throw during host decode.

Validation artifacts were saved under ~/progress/agent-os/2026-07-07-stat-u64-bigint-fix/. Gates: pnpm build passed, pnpm check-types passed, runtime-browser unit Vitest passed, node scripts/verify-fixed-versions.mjs passed. Runtime-core Vitest only has the three noted pre-existing failures: protocol auth bytes, request-payloads maxDepth, and binary resolution.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant