Guest `node` ignores stdin as the program, and `node --input-type=module` reading stdin reports "command not found: node"
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript, rust, wasm
- 領域
- backend, cli, operating-systems
調査の方向性
Start by reading the WASM shell stdin redirection issue #1657 and trace how guest commands are parsed and how stdin reaches the Node process. Reproduce the listed commands in a fresh VM, then locate the shell and Node runtime entry points involved; the issue does not name files or tests. Done means stdin scripts run with and without --input-type=module, unsupported flags report the flag, and /dev/stdin is available.
索引モデルが issue の本文から書いたものです。
説明
@rivet-dev/agentos-core 0.4.1, @rivet-dev/agentos-sidecar-linux-x64-gnu 0.2.22, Linux x64. Deterministic: it happens on an idle, fresh VM with no load.
import { AgentOs } from "@rivet-dev/agentos-core";
const vm = await AgentOs.create();
for (const command of [
"node --input-type=module <<'JS'\nconsole.log('ok')\nJS",
"echo \"console.log('ok')\" | node --input-type=module",
"echo \"console.log('ok')\" | node",
"node <<'JS'\nconsole.log('ok')\nJS",
"node -e \"process.stdin.on('data', (d) => console.log('got', String(d)))\" <<'X'\nhello\nX",
"node -e \"require('fs').readFileSync('/dev/stdin', 'utf8')\" < /etc/hostname",
"node --no-warnings -e 'console.log(1)'",
]) {
const r = await vm.process.exec(command, { output: { capture: "all" } });
console.log(JSON.stringify(command), r.exitCode, JSON.stringify(r.stdout + r.stderr));
}
await vm.dispose();
| Command | Expected | Actual |
|---|---|---|
node --input-type=module <<'JS' … JS |
runs the module, prints ok |
exit 127, error: command not found: node |
echo … | node --input-type=module |
prints ok |
exit 127, error: command not found: node |
echo … | node / node <<'JS' … JS |
prints ok |
exit 0, prints nothing (the program is never run) |
process.stdin.on('data') with stdin from a heredoc |
prints got hello |
exit 0, prints nothing |
readFileSync('/dev/stdin') |
the input | ENOENT … '/dev/stdin' |
node --no-warnings -e … |
prints 1 |
Cannot find module '/workspace/--no-warnings' |
command -v node prints /bin/node, node -e, node file.mjs and readFileSync(0) with piped stdin all work. The first row is the harmful one: coding agents commonly write node --input-type=module <<'JS', get "command not found: node", and conclude Node is not installed, then stop using it for the rest of the session.
Expected: node with no script reads the program from stdin (as node - does), --input-type applies to it, unknown or unsupported flags fail with a message naming the flag rather than as a missing command or module, and /dev/stdin exists.
Possibly related: #1657 (< file stdin redirection in the WASM shell).
- 主要言語
- Rust
- スター
- 4.8k
- フォーク
- 270
- 平均マージ
- 14時間 28分
- マージ済み PR(30日)
- 55
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rivet-dev/agentos のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 32/100
rivet-dev/agentos#2020 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Inline JavaScript resolves dynamic import() from / instead of the working directory対応中かも @mittal-parth が 39 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
rivet-dev/agentos#1973 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
rivet-dev/agentos の issue をすべて見る
似ている issue
-
Add a just recipe that runs the workflow linters locally対応中かも @sgamelin が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
good first issue security
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
Status bar: a progress line that keeps the same text (import at 0%) ages out after 8 s and blinksオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
transit-audio/transit#216 ·
-
area: effects devices enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
suhina-daw/suhina-daw#1060 ·
メンテナーはふだん 1 日以内に返信