WasmVM brush-shell: `>>` append truncates and `< file` stdin redirection fails
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- rust, shell, typescript, wasm
調査の方向性
まず、提供された pnpm コマンドで packages/runtime-core/tests/integration/bridge-child-process.test.ts を実行し、失敗している append と stdin-redirection のケースを調査します。次に、WASI パスとリダイレクトのサポートについて、関連する toolchain/std-patches/crates/brush-* の領域を読みます。append が既存の内容を保持し、cat < stdin-input.txt が VFS ファイルの内容で正常終了すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Two shell-redirection behaviors are broken in the WasmVM guest shell
(brush-shell), surfaced by the runtime-core integration suite:
- Append redirection (
>>) truncates instead of appending. - Stdin redirection (
cmd < file) fails with a non-zero exit.
Both diverge from Linux/POSIX shell semantics.
Failing tests
packages/runtime-core/tests/integration/bridge-child-process.test.ts
| Test | Expected | Actual |
|---|---|---|
execSync append redirection onto a write-only file succeeds like Linux |
file contains originalchanged (append) |
changed — the >> truncated the file instead of appending |
execSync stdin redirection feeds the kernel VFS file to the command |
cat < stdin-input.txt exits 0 with the file contents |
Error: Command failed: cat < stdin-input.txt, exit code 1 |
Exact assertion output:
× execSync append redirection onto a write-only file succeeds like Linux
→ expected 'changed' to be 'originalchanged' // Object.is equality
× execSync stdin redirection feeds the kernel VFS file to the command
→ stdout:
Error: Command failed: cat < stdin-input.txt
: expected 1 to be +0 // Object.is equality
Repro
# build/vendor the WASM commands, then:
pnpm --filter @rivet-dev/agentos-runtime-core exec vitest run \
tests/integration/bridge-child-process.test.ts
The tests route child_process.execSync(...) through the bridge → kernel →
WasmVM sh (brush-shell), so the failures are in the guest shell's handling of
>> and <, not in the Node bridge.
Suspected root cause
>>: the append open-mode is not honored against the kernel VFS — the
file is opened truncating (O_WRONLY|O_TRUNC) instead of appending
(O_WRONLY|O_APPEND). Related patched area:
toolchain/std-patches/crates/brush-*(WASI path/redirection support).< file: input redirection from a VFS path is not wired to the command's
stdin, socatreads nothing and exits non-zero.
Not a regression
These predate and are unrelated to the registry→software flatten/colocation
refactor. Verified: the failing test file is unchanged, the vendored
runtime-core/commands binaries the test runs are unchanged, the brush-shell
source patches only moved (0 content delta), and the only runtime-core source
change is a moot commands-dir path string. The failures reproduce identically on
the parent revision.
Impact
Any guest program relying on >> append or < stdin redirection behaves
incorrectly (silent data loss on append; command failure on stdin redirect).
Related (separate issue)
The same integration run also has a WasmVM signal/dispose cluster — SIGKILL/
SIGTERM not terminating guest processes and dispose timing out
(signal-forwarding.test.ts, dispose-behavior.test.ts). Distinct root cause
(process signal delivery, not shell redirection); should be tracked separately.
- 主要言語
- Rust
- スター
- 4.8k
- フォーク
- 275
- 平均マージ
- 13時間 37分
- マージ済み PR(30日)
- 48
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rivet-dev/agentos のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
rivet-dev/agentos#2087 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 32/100
rivet-dev/agentos#2020 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
rivet-dev/agentos の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
メンテナーはふだん 1 日以内に返信
-
A match arm above the largest i64 is compared as 0対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
DioxusLabs/dioxus#6063 ·
メンテナーはふだん 1 日以内に返信
-
`nsh-core` fails to compile when taffy's default `calc` feature is enabled elsewhere in the graphオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
longbridge/nsh#966 ·
メンテナーはふだん 1 日以内に返信
-
Windows docs: pin a tested ConPTY version for Kitty graphics; 1.25.260930003 corrupts large uploadsオープン
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
raphamorim/rio#2021 ·
メンテナーはふだん 1 日以内に返信