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

Command sandbox: no process or memory limits on macOS (Seatbelt)

Abierto
#104 1 comentario 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
38/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
docker, typescript
Área
desktop, security

Línea de trabajo

Start by locating the existing DEFAULT_LIMITS and the Linux bubblewrap, macOS Seatbelt, and container command-launch paths; the issue does not name their files. Read the backend tests and docs/USAGE.md to understand current behavior. Done means process and memory limits are applied where supported, failures are logged without blocking command execution, documentation is updated, and real backend tests verify fork and memory limits while ordinary commands still pass.

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

Descripción

enhancement platform: linux platform: macos priority: medium security severity: low

Problem

The command sandboxes apply different resource limits:

Backend Processes Memory Time
Windows AppContainer job object limit (512) per process (8 GB) tool timeout
Docker/Podman --pids-limit=1024 none tool timeout
Linux bubblewrap none none tool timeout
macOS Seatbelt none none tool timeout

On Linux and macOS a sandboxed command, whether a runaway test or a prompt-injected one, can fork-bomb or exhaust memory. That hangs the user's machine and Patch with it. Background commands have no timeout, so a background command can keep consuming resources until it is stopped.

Proposed outcome

  • Linux: run bubblewrap commands in a transient cgroup with pids.max and memory.max, for example through systemd-run --user --scope -p TasksMax=… -p MemoryMax=… when it is available. Otherwise use prlimit/setrlimit for the number of processes and the address space.
  • macOS: apply setrlimit (RLIMIT_NPROC, RLIMIT_AS or RLIMIT_DATA) before sandbox-exec, through a small launcher if needed.
  • Containers: add --memory (and --memory-swap) next to --pids-limit.
  • Use the same defaults as Windows (DEFAULT_LIMITS: 512 processes, 8 GB), in one place, and describe them in docs/USAGE.md.
  • If a limit can't be applied, the command still runs (these limits are not a security boundary) and the app log records that.

Acceptance checks

  • Real backend tests: a fork loop stops at the process limit and a memory hog is killed, while an ordinary build or test command still passes.

Follow-up to #76.

Lenguaje dominante
TypeScript
Estrellas
2
Forks
2
Merge medio
8 h 28 min
PR fusionados (30 d)
26

Preparar el entorno

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 PierrunoYT/patch

Todos los issues de PierrunoYT/patch

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.