abhigyanpatwari/GitNexus · error · ManagedProcessError
managed command failed ({result.state}, exit={result.returnc
Error message
managed command failed ({result.state}, exit={result.returncode}): {result.detail or result.stderr_tail[-1000:]} What it means
A ManagedProcessError raised after a task's setup command run via sandbox.run(...) returned a non-ok result (state != 'exited' or returncode != 0). The message records the process state, exit code, and either the result.detail or the last 1000 chars of stderr_tail. This is the harness telling you the task's own setup script failed inside the bubblewrap boundary, aborting the arm before the model session starts.
Source
Thrown at eval/workflow_bench/runner.py:1136
],
preflight=False,
) as sandbox:
# Capture the BASE (pre-overlay) skill digest — identical
# for the incumbent and candidate arms — then run the
# task's untrusted setup against those base skills. The
# candidate overlay is applied only afterwards, so setup
# can never observe candidate prose and both arms share
# byte-identical pre-overlay state.
base_skill_digest = skill_fingerprint(worktree, execution_arm)
if task.get("setup"):
setup_command = ["/bin/sh", "-lc", str(task["setup"])]
setup = sandbox.run(
setup_command,
timeout=600,
env=build_sandbox_environment(),
)
if not setup.ok:
raise ManagedProcessError(setup_command, setup)
# Tamper-evidence: setup must not have rewritten the base
# skills, verified before any candidate overlay lands.
require_skill_fingerprint(
worktree,
execution_arm,
base_skill_digest,
phase="task setup",
)
if arm in CANDIDATE_ARMS:
assert candidate_overlay is not None
applied_digest = apply_candidate_overlay(
candidate_overlay,
worktree,
sandbox=sandbox,
)
if applied_digest != overlay_digest:
raise RuntimeError("candidate overlay changed during the benchmark run")
# The digest the model must preserve during its run is theView on GitHub (pinned to d540b00184)
Solutions
- Read the embedded stderr_tail/detail in the message — it is the setup command's own failure output.
- Run the setup command manually in the same worktree/SHA with the sandbox environment to reproduce: `bash -lc '<setup>'` after exporting build_sandbox_environment() vars.
- Fix the setup script (correct paths, install the right deps, handle the sandbox's allowlisted env / possible network unsharing).
- If the 600s timeout was hit, optimize the setup step or break it into faster pieces; do not silently raise the timeout.
Example fix
# before — setup fails: missing dependency setup: | cd gitnexus && npx vitest --version # vitest not installed yet # after — install before invoking setup: | cd gitnexus && npm ci && npx vitest --version
Defensive patterns
Strategy: try-catch
Validate before calling
# reproduce the setup command in the same sandbox env before the arm runs
result = sandbox.run(['/bin/sh', '-lc', str(task['setup'])], timeout=600, env=build_sandbox_environment())
if not result.ok:
raise SystemExit(f'setup failed: {result.detail or result.stderr_tail[-1000:]}') Try / catch
from .process_control import ManagedProcessError
try:
if task.get('setup'):
setup = sandbox.run(['/bin/sh', '-lc', str(task['setup'])], timeout=600, env=build_sandbox_environment())
if not setup.ok:
raise ManagedProcessError(['/bin/sh', '-lc', str(task['setup'])], setup)
except ManagedProcessError as exc:
# inspect exc.result.state, returncode, stderr_tail/detail for the cause
raise Prevention
- Test each task's setup script locally with the sandbox environment before authoring.
- Account for the sandbox's allowlisted env and possible network unsharing in setup.
- Keep setup steps under the 600s timeout; optimize slow installs rather than lengthening it.
When it happens
Trigger: task['setup'] is a shell command; it is run as `/bin/sh -lc <setup>` with a 600s timeout via sandbox.run; setup.ok is False — the command exited non-zero, timed out, or was force-killed, so `raise ManagedProcessError(setup_command, setup)` fires.
Common situations: The setup script has a bug or references a missing file/tool; a dependency install (npm/pip) failed due to network or registry issues (note: sandbox may unshare-net); the setup command exceeded the 600s timeout; an env var or path expected by setup is not present in build_sandbox_environment(); a flaky external resource the setup reaches for is unavailable.
Related errors
- managed command failed ({result.state}, exit={result.returnc
- {label} is unavailable: {path}: {exc}
- {label} must be a real non-symlink directory: {path}
- {label} contains an unsafe path component: {relative}
- {label} is unreadable: {path}: {exc}
AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12).
Data as JSON: /api/errors/f6fdbdd22d8ebdca.
Report an issue: GitHub.