Sandbox-Aware Test Ops
Overview
Use this skill when the user asks to run tests or experiments and the command may fail because of sandbox restrictions, missing network access, missing GPU visibility, or the wrong Python environment.
The goal is to keep execution moving: detect the blocker quickly, switch to the right conda env, and re-run with escalated permissions when needed.
Workflow
- Inspect the task before running it.
- Identify whether it is local-only, network-backed, GPU-backed, or environment-sensitive.
- Treat these as likely escalation cases: package install, model download, API calls, external datasets, CUDA checks, long training jobs, tmux/nohup, writes outside the workspace, or commands that already failed in sandbox for environment reasons.
- Probe the environment instead of guessing.
- Check available conda envs with
conda env list.
- If the command is Python-based, probe candidate envs with
conda run -n <env> python -c ... for the exact imports the task needs, such as torch, trl, transformers, pytest, or task-specific packages.
- If GPU may matter, check
nvidia-smi and prefer an env where the required stack is already installed.
- Prefer the project-specific env when the repo config already names one. Otherwise choose the first env that proves it has the required imports.
- Start with the cheapest viable execution path.
- Use the sandbox only when the command is clearly local and the required packages are already present.
- If the task obviously needs network, GPU, or writes outside sandboxed roots, request escalated execution immediately instead of waiting for a predictable failure.
- If the first sandboxed attempt fails because of DNS, host resolution, authentication, blocked filesystem access, CUDA visibility, or missing packages in the default shell, re-run with escalated execution and the best conda env.
- Escalate through the tool, not through chat.
- Use the execution tool's escalation flow directly with a short justification.
- Do not stop to ask the user in plain chat before making the escalation request.
- When possible, request a narrow reusable prefix rule that matches the command family, such as
pytest, conda run -n <env> python, or nvidia-smi.
- Preserve experiment hygiene.
- Keep the repo's normal artifact layout, logs, and summaries.
- For long or expensive runs, prefer smoke checks first unless the user explicitly wants the full run immediately.
- When a command fails, report whether the root cause was sandbox, API/network, missing package, wrong env, missing checkpoint/data, or code logic.
Operating Rules
- Prefer
conda run -n <env> over the system python3 when the repo uses ML or evaluation stacks.
- Never assume the default shell has the right packages.
- If a command needs the internet, authenticated APIs, GPU, or non-workspace writes, bias toward escalated execution.
- If a command is important and fails in sandbox with a likely restrictions-related error, retry with escalation instead of giving up.
- If no suitable env exists, say exactly which imports are missing and which envs were checked.
- If credentials are missing, surface the exact variable or file expected.
Common Patterns
For package/env mismatches:
conda env list
conda run -n multi-agent python -c "import torch, trl, transformers"
For network- or API-backed smoke tests:
conda run -n multi-agent python scripts/experiments/run_agent_smoke.py --worker-backend qwen --worker-model qwen14b-local --require-worker-api-calls
Run this with escalated permissions when the endpoint or auth may be blocked by sandbox.
For training or evaluation jobs:
conda run -n <best-env> python scripts/experiments/run_rl_train.py ...
conda run -n <best-env> python scripts/experiments/run_eval.py ...
Use escalated execution when GPU visibility, model downloads, or external APIs are required.
1---2name: sandbox-aware-test-ops3description: Run tests, smoke checks, training jobs, and benchmark pipelines when sandbox, network, GPU, package, or environment issues may block normal execution. Use when a task involves pytest/unittest, experiment scripts, conda environments, API-backed evaluation, model downloads, CUDA, or other commands that may need escalated permissions or a different runtime than the default shell.4---56# Sandbox-Aware Test Ops78## Overview910Use this skill when the user asks to run tests or experiments and the command may fail because of sandbox restrictions, missing network access, missing GPU visibility, or the wrong Python environment.11The goal is to keep execution moving: detect the blocker quickly, switch to the right conda env, and re-run with escalated permissions when needed.1213## Workflow14151. Inspect the task before running it.16- Identify whether it is local-only, network-backed, GPU-backed, or environment-sensitive.17- Treat these as likely escalation cases: package install, model download, API calls, external datasets, CUDA checks, long training jobs, tmux/nohup, writes outside the workspace, or commands that already failed in sandbox for environment reasons.18192. Probe the environment instead of guessing.20- Check available conda envs with `conda env list`.21- If the command is Python-based, probe candidate envs with `conda run -n <env> python -c ...` for the exact imports the task needs, such as `torch`, `trl`, `transformers`, `pytest`, or task-specific packages.22- If GPU may matter, check `nvidia-smi` and prefer an env where the required stack is already installed.23- Prefer the project-specific env when the repo config already names one. Otherwise choose the first env that proves it has the required imports.24253. Start with the cheapest viable execution path.26- Use the sandbox only when the command is clearly local and the required packages are already present.27- If the task obviously needs network, GPU, or writes outside sandboxed roots, request escalated execution immediately instead of waiting for a predictable failure.28- If the first sandboxed attempt fails because of DNS, host resolution, authentication, blocked filesystem access, CUDA visibility, or missing packages in the default shell, re-run with escalated execution and the best conda env.29304. Escalate through the tool, not through chat.31- Use the execution tool's escalation flow directly with a short justification.32- Do not stop to ask the user in plain chat before making the escalation request.33- When possible, request a narrow reusable prefix rule that matches the command family, such as `pytest`, `conda run -n <env> python`, or `nvidia-smi`.34355. Preserve experiment hygiene.36- Keep the repo's normal artifact layout, logs, and summaries.37- For long or expensive runs, prefer smoke checks first unless the user explicitly wants the full run immediately.38- When a command fails, report whether the root cause was sandbox, API/network, missing package, wrong env, missing checkpoint/data, or code logic.3940## Operating Rules4142- Prefer `conda run -n <env>` over the system `python3` when the repo uses ML or evaluation stacks.43- Never assume the default shell has the right packages.44- If a command needs the internet, authenticated APIs, GPU, or non-workspace writes, bias toward escalated execution.45- If a command is important and fails in sandbox with a likely restrictions-related error, retry with escalation instead of giving up.46- If no suitable env exists, say exactly which imports are missing and which envs were checked.47- If credentials are missing, surface the exact variable or file expected.4849## Common Patterns5051For package/env mismatches:52```bash53conda env list54conda run -n multi-agent python -c "import torch, trl, transformers"55```5657For network- or API-backed smoke tests:58```bash59conda run -n multi-agent python scripts/experiments/run_agent_smoke.py --worker-backend qwen --worker-model qwen14b-local --require-worker-api-calls60```61Run this with escalated permissions when the endpoint or auth may be blocked by sandbox.6263For training or evaluation jobs:64```bash65conda run -n <best-env> python scripts/experiments/run_rl_train.py ...66conda run -n <best-env> python scripts/experiments/run_eval.py ...67```68Use escalated execution when GPU visibility, model downloads, or external APIs are required.