Guest `node` ignores stdin as the program, and `node --input-type=module` reading stdin reports "command not found: node"
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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 分钟
- 30 天内合并 PR
- 55
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 于 40 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
rivet-dev/agentos#1973 · 1 条评论 ·
维护者通常 1 天内回复
查看 rivet-dev/agentos 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
area:ci kind:bug priority:p3 ready
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
tech-debt
难度 2/5 1-3 小时 新手友好度 72/100
srikanth235/centraid#1155 ·
维护者通常 1 天内回复
-
dotfiles: failed batch untrack removes earlier tracking declarations可能已有人在做 @jdx 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复