Host-function command output doesn't reach a shell pipe, redirection or command substitution
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
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, rust, wasm
Direzione di ricerca
The issue identifies shell pipelines, redirection, and command substitution as failing, with #1967 and #1983 as related context; it names no source files or tests. Start by tracing how host-function commands are dispatched through the VM shell and compare that path with ordinary shell command output. Done when the listed shell forms receive the host function's output and a regression test covers them.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Written by an AI agent (Claude) on behalf of @jasonkuhrt.
A host-function command's output reaches the caller when the command runs on its own, but not through a pipe, a redirection or a command substitution in the VM's shell. Those all see empty output, and the command still exits 0.
Reproduction on @rivet-dev/agentos-core 0.4.4: one collection, probe, with a ping function returning { pong: 'hello' }, and vm.process.exec(command, { output: { capture: 'all' } }) for each command.
| Command | stdout |
|---|---|
agentos-probe ping --json '{}' |
{"ok":true,"result":{"pong":"hello"}} |
agentos-probe ping --json '{}' | cat |
empty |
agentos-probe ping --json '{}' | wc -c |
0 |
agentos-probe ping --json '{}' > /tmp/out.json; wc -c < /tmp/out.json |
0: the file is empty |
x="$(agentos-probe ping --json '{}')"; echo "[$x]" |
[] |
echo '{"pong":"hello"}' | cat (control) |
{"pong":"hello"} |
const vm = await AgentOs.create({
permissions: { fs: 'allow', childProcess: 'allow', process: 'allow', hostFunction: 'allow', network: 'deny', env: 'deny' },
hostFunctions: {
probe: {
ping: { inputSchema: z.object({}), execute: () => ({ pong: 'hello' }) },
},
},
});
await vm.process.exec(`agentos-probe ping --json '{}' | cat`, {
cwd: '/', timeoutMs: 30_000, output: { capture: 'all' },
});
So a guest can't compose host functions with ordinary shell tools, such as agentos-x list | jq …, > file, or $(…). The silent empty output is worse than an error: a script carries on with nothing.
We work around it by running a host-function command only on its own, through execFile, and refusing pipelines, lists and redirections that contain one.
Possibly related: #1967 delivers JS processes' stdout and stderr to a redirected fd, and #1983 fixed dispatching shell-spawned binding stubs. We haven't checked whether #1967 covers host-function commands.
- 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 45/100
rivet-dev/agentos#2087 · 2 commenti ·
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 41 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
-
Published SDL drops input-field default values: a non-null field with a default renders as requiredAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
色変記事を追加Apertapriority middle
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
KATO-Hiro/AtCoderClans#12955 ·
I maintainer di solito rispondono entro 1 giorno
-
auto:doc-drift auto:producer
Difficoltà 2/5 1-3 ore Idoneità per principianti 60/100
fritzprix/libr-agent#2458 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
yantrikos/yantrik-os#1048 ·
I maintainer di solito rispondono entro 1 giorno
-
rust
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
vllm-project/vllm#64939 ·
I maintainer di solito rispondono entro 1 giorno