Guest `node` ignores stdin as the program, and `node --input-type=module` reading stdin reports "command not found: node"
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, rust, wasm
- Ambito
- backend, cli, operating-systems
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
@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).
- Lingua principale
- Rust
- Stelle
- 4.8k
- Fork
- 270
- Merge medio
- 14h 28m
- PR unite (30g)
- 55
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rivet-dev/agentos
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 32/100
rivet-dev/agentos#2020 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Inline JavaScript resolves dynamic import() from / instead of the working directoryForse già presa @mittal-parth l’ha presa 39 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rivet-dev/agentos#1973 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rivet-dev/agentos
Issue simili
-
area: library data-loss type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
alplabai/signex#1740 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
test(fslc): the unreadable mutate catalog test pins the Unix I/O error text and fails on WindowsForse già presa @rizumita l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
I maintainer di solito rispondono entro 1 giorno
-
ServerProperties defaults white-list to true, so a fresh --dedicated server silently locks itselfAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
horizon-rust/horizon#3888 ·
I maintainer di solito rispondono entro 1 giorno
-
refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno