Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Host-function command output doesn't reach a shell pipe, redirection or command substitution

Abierto
#2,082 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript, rust, wasm
Área
backend, cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
4.8k
Forks
270
Merge medio
14 h 28 min
PR fusionados (30 d)
55

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rivet-dev/agentos

Todos los issues de rivet-dev/agentos

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.