1---2name: examples-auto-run3description: Run examples:start-all in auto mode with parallel execution, per-script logs, and start/stop helpers.4---56# examples-auto-run78## What it does910- Runs `pnpm build && pnpm -r build-check` first11- Runs `pnpm examples:start-all` in auto-input mode (interactive prompts are auto-answered, HITL/MCP/apply-patch are auto-approved).12- Executes starts in parallel (default concurrency 4) and pipes each start’s stdout/stderr into its own log file under `.tmp/examples-start-logs/`.13- Provides start/stop/status/logs/tail helpers via `run.sh`.14- If the Codex session ends (no disown/nohup), the child processes receive SIGHUP and exit; `stop` is also available to clean up manually.1516## Usage1718```bash19# Start (auto mode, concurrency=4 by default)20.codex/skills/examples-auto-run/scripts/run.sh start [extra args to examples:start-all]21# If you invoke the skill name alone ($examples-auto-run):22# - when `.tmp/examples-rerun.txt` exists and is non-empty, it will run `rerun` automatically23# - otherwise it runs the default `start` command.2425# Examples:26.codex/skills/examples-auto-run/scripts/run.sh start --filter basic27.codex/skills/examples-auto-run/scripts/run.sh start --include-server --include-audio2829# Check status30.codex/skills/examples-auto-run/scripts/run.sh status3132# Stop running job (kills pid from .tmp/examples-auto-run.pid)33.codex/skills/examples-auto-run/scripts/run.sh stop3435# List logs (per start script)36.codex/skills/examples-auto-run/scripts/run.sh logs3738# Tail latest log39.codex/skills/examples-auto-run/scripts/run.sh tail40.codex/skills/examples-auto-run/scripts/run.sh tail basic__start_hello-world.log4142# After a run, build a rerun list from the latest main log (auto-skip list is imported from `scripts/run-example-starts.mjs` and server/audio/external skips are honored)43.codex/skills/examples-auto-run/scripts/run.sh collect44# Rerun only the entries in .tmp/examples-rerun.txt45.codex/skills/examples-auto-run/scripts/run.sh rerun46# Show the current auto-skip list (env or defaults)47.codex/skills/examples-auto-run/scripts/run.sh start --print-auto-skip --dry-run48```4950## Defaults (overridable via env)5152- `EXAMPLES_INTERACTIVE_MODE=auto`53- `AUTO_APPROVE_MCP=1`, `APPLY_PATCH_AUTO_APPROVE=1`, `AUTO_APPROVE_HITL=1` (set in runner)54- `EXAMPLES_CONCURRENCY=4`55- `EXAMPLES_EXECA_TIMEOUT_MS=300000` (5m) 56 `financial-research-agent` and `computer-use` use 10m inside the script.57- Includes interactive; excludes server/audio/external by default:58 - `EXAMPLES_INCLUDE_INTERACTIVE=1`59 - `EXAMPLES_INCLUDE_SERVER=0`60 - `EXAMPLES_INCLUDE_AUDIO=0`61- `EXAMPLES_INCLUDE_EXTERNAL=0`62 - This means `realtime-*` / `nextjs` (tagged as server/audio) are skipped unless you opt in with `--include-server` / `--include-audio` or the corresponding env flags.63- Auto-skip list: `EXAMPLES_AUTO_SKIP` (comma/space separated) overrides the built-in defaults used by both `run.sh` and `run-example-starts.mjs`. Defaults include `agent-patterns:start:llm-as-a-judge`, `agent-patterns:start:routing`, `customer-service:start`, `connectors:start`, `mcp:start:hosted-mcp-on-approval`, `mcp:start:hosted-mcp-human-in-the-loop`.6465## Cancellation / cleanup6667- Jobs are backgrounded but not disowned; if Codex suspends/ends the shell, the process group gets SIGHUP and stops.68- Manual cleanup: `run.sh stop` (removes stale pid if already exited).6970## Log locations7172- `.tmp/examples-start-logs/<package>__<script>.log` (per start)73- Main runner log path is printed when `start` is invoked.74- Rerun list (generated by `collect`): `.tmp/examples-rerun.txt` (one `package:script` per line).7576## Notes7778- Auto-skip is centralized (same defaults as above) and can be overridden via `EXAMPLES_AUTO_SKIP`. Auto-skip entries are excluded from rerun collection and will be removed from rerun execution automatically.79- Auto-input map covers common interactive prompts; HITL/MCP/apply-patch auto-approve via env is enabled by the runner.80- Shell tool approvals are auto-approved in auto mode (`SHELL_AUTO_APPROVE=1`).81- `rerun` runs entries sequentially, continues after failures, and rewrites `.tmp/examples-rerun.txt` with only the remaining failures. Auto-skip entries are not re-added.82- Behavioral validation is _not_ done in the runner, so **Codex must immediately perform it after every `start` or `rerun` invocation without waiting for the user to ask.** Required steps:83 1. Read the example source to infer intended flow from code/comments (tools invoked, expected outputs, guards, approvals).84 2. Read the matching log under `.tmp/examples-start-logs/`.85 3. Compare intent vs. log: confirm key actions/results happened; flag omissions or divergences.86 4. Do this for **all exit-0 entries**, not just samples.87 5. Summarize findings right after the run completes; when “OK”, note what was checked (e.g., “tools called + final message emitted”).88 6. When reporting, do not omit or ellipsize outputs that justify the validation; include the full relevant lines (keep it concise but untruncated).89- The runner prints a full table after the summary: one row per start script with `status`, `package:script`, `info` (reason/exit/skipped), and the log path. If the run stops before the table appears, point the analyzer at the latest `main_*.log` to reconstruct a table and validations.