
Examples Auto Run
- 103 installs
- 3.5k repo stars
- Updated August 4, 2026
- openai/openai-agents-js
openai-agents-js examples:start-all auto mode parallel execution with per-script logs.
About
openai-agents-js examples auto-run skill for executing examples:start-all in auto mode. Parallel execution of all example scripts with per-script log capture and start/stop helper utilities. Validates that SDK examples run successfully against configured providers in batch. Used for smoke testing the examples directory after changes to core packages or provider integrations.
- examples:start-all auto mode with parallel execution
- Per-script log capture for failure diagnosis
- Start and stop helper utilities for example management
- Batch smoke test of all SDK examples
- Post-change validation for examples directory
Examples Auto Run by the numbers
- 103 all-time installs (skills.sh)
- +4 installs in the week ending Jul 26, 2026 (Skillselion tracking)
- Ranked #981 of 2,154 Testing & QA skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
examples-auto-run capabilities & compatibility
- Capabilities
- run examples parallel · capture per script logs · manage example lifecycle
- Use cases
- testing
What examples-auto-run says it does
Run examples:start-all in auto mode with parallel execution, per-script logs, and start/stop helpers.
npx skills add https://github.com/openai/openai-agents-js --skill examples-auto-runAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 103 |
|---|---|
| repo stars | ★ 3.5k |
| Last updated | August 4, 2026 |
| Repository | openai/openai-agents-js ↗ |
How do I run all SDK examples in parallel with logs?
Run examples:start-all in auto mode with parallel execution, per-script logs, and start/stop helpers in openai-agents-js.
Who is it for?
Maintainers smoke testing examples after SDK or provider changes.
Skip if: Single example debugging or unit test runs.
When should I use this skill?
User asks to run examples:start-all in auto mode with parallel execution.
What you get
All examples executed in auto mode with per-script logs for failure diagnosis.
Files
examples-auto-run
What it does
- Runs
pnpm build && pnpm -r build-checkfirst - Runs
pnpm examples:start-allin auto-input mode (interactive prompts are auto-answered, HITL/MCP/apply-patch are auto-approved). - Executes starts in parallel (default concurrency 4) and pipes each start’s stdout/stderr into its own log file under
.tmp/examples-start-logs/. - Provides start/stop/status/logs/tail helpers via
run.sh. - If the Codex session ends (no disown/nohup), the child processes receive SIGHUP and exit;
stopis also available to clean up manually.
Usage
# Start (auto mode, concurrency=4 by default)
.agents/skills/examples-auto-run/scripts/run.sh start [extra args to examples:start-all]
# If you invoke the skill name alone ($examples-auto-run):
# - when `.tmp/examples-rerun.txt` exists and is non-empty, it will run `rerun` automatically
# - otherwise it runs the default `start` command.
# Examples:
.agents/skills/examples-auto-run/scripts/run.sh start --filter basic
.agents/skills/examples-auto-run/scripts/run.sh start --include-server --include-audio
# Check status
.agents/skills/examples-auto-run/scripts/run.sh status
# Stop running job (kills pid from .tmp/examples-auto-run.pid)
.agents/skills/examples-auto-run/scripts/run.sh stop
# List logs (per start script)
.agents/skills/examples-auto-run/scripts/run.sh logs
# Tail latest log
.agents/skills/examples-auto-run/scripts/run.sh tail
.agents/skills/examples-auto-run/scripts/run.sh tail basic__start_hello-world.log
# 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)
.agents/skills/examples-auto-run/scripts/run.sh collect
# Rerun only the entries in .tmp/examples-rerun.txt
.agents/skills/examples-auto-run/scripts/run.sh rerun
# Show the current auto-skip list (env or defaults)
.agents/skills/examples-auto-run/scripts/run.sh start --print-auto-skip --dry-runDefaults (overridable via env)
EXAMPLES_INTERACTIVE_MODE=autoAUTO_APPROVE_MCP=1,APPLY_PATCH_AUTO_APPROVE=1,AUTO_APPROVE_HITL=1(set in runner)EXAMPLES_CONCURRENCY=4sandbox:start:memory-generationis still serialized by the runner because its pre-stop memory generation can contend with shared local resources. Other hosted, Unix-local, and Docker sandbox examples remain parallelized.EXAMPLES_EXECA_TIMEOUT_MS=300000(5m)
financial-research-agent and computer-use use 10m inside the script.
- Includes interactive; excludes server/audio/external by default:
EXAMPLES_INCLUDE_INTERACTIVE=1EXAMPLES_INCLUDE_SERVER=0EXAMPLES_INCLUDE_AUDIO=0EXAMPLES_INCLUDE_EXTERNAL=0- This means
realtime-*/nextjs(tagged as server/audio) are skipped unless you opt in with--include-server/--include-audioor the corresponding env flags. - Auto-skip list:
EXAMPLES_AUTO_SKIP(comma/space separated) overrides the built-in defaults used by bothrun.shandrun-example-starts.mjs. Defaults includeagent-patterns:start:llm-as-a-judge,connectors:start,mcp:start:hosted-mcp-on-approval,mcp:start:hosted-mcp-human-in-the-loop,tools:start:codex,tools:start:codex-same-thread.
Codex execution environment
- When Codex invokes
startorrerun, run the command outside the Codex sandbox by default (sandbox_permissions=require_escalated). Several examples start nested sandboxes, browsers, npm helpers, or local service processes; running from inside the Codex sandbox can produce environment-only failures such as Playwright browser launch permission errors, npm cache permission errors, or nested sandbox setup errors. - Use sandboxed execution only when the user explicitly asks for it or when running a narrow dry-run / log inspection command that does not execute examples.
Cancellation / cleanup
- Jobs are backgrounded but not disowned; if Codex suspends/ends the shell, the process group gets SIGHUP and stops.
- Manual cleanup:
run.sh stop(removes stale pid if already exited).
Log locations
.tmp/examples-start-logs/<package>__<script>.log(per start)- Main runner log path is printed when
startis invoked. - Rerun list (generated by
collect):.tmp/examples-rerun.txt(onepackage:scriptper line).
Notes
- 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. - Auto-input map covers common interactive prompts; HITL/MCP/apply-patch auto-approve via env is enabled by the runner.
- Shell tool approvals are auto-approved in auto mode (
SHELL_AUTO_APPROVE=1). rerunruns entries sequentially, continues after failures, and rewrites.tmp/examples-rerun.txtwith only the remaining failures. Auto-skip entries are not re-added.- 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:
1. Read the example source to infer intended flow from code/comments (tools invoked, expected outputs, guards, approvals). 2. Read the matching log under .tmp/examples-start-logs/. 3. Compare intent vs. log: confirm key actions/results happened; flag omissions or divergences. 4. Do this for all exit-0 entries, not just samples. 5. Summarize findings right after the run completes; when “OK”, note what was checked (e.g., “tools called + final message emitted”). 6. When reporting, do not omit or ellipsize outputs that justify the validation; include the full relevant lines (keep it concise but untruncated).
- 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 latestmain_*.logto reconstruct a table and validations.
interface:
display_name: "Examples Auto Run"
short_description: "Run examples in auto mode with logs and rerun helpers"
default_prompt: "Use $examples-auto-run to run the repo examples in auto mode, collect logs, and summarize any failures."
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../.." && pwd)"
PID_FILE="$ROOT/.tmp/examples-auto-run.pid"
LOG_DIR="$ROOT/.tmp/examples-start-logs"
RERUN_FILE="$ROOT/.tmp/examples-rerun.txt"
ensure_dirs() {
mkdir -p "$LOG_DIR" "$ROOT/.tmp"
}
is_running() {
local pid="$1"
[[ -n "$pid" ]] && ps -p "$pid" >/dev/null 2>&1
}
run_examples_preflight() {
pnpm build
pnpm -r build-check
}
run_examples_start() {
pnpm examples:start-all --include-interactive "$@"
}
start_runner() {
local log_file="$1"
shift
export EXAMPLES_MAIN_LOG="$log_file"
export EXAMPLES_INTERACTIVE_MODE="${EXAMPLES_INTERACTIVE_MODE:-auto}"
export AUTO_APPROVE_MCP="${AUTO_APPROVE_MCP:-1}"
export APPLY_PATCH_AUTO_APPROVE="${APPLY_PATCH_AUTO_APPROVE:-1}"
export AUTO_APPROVE_HITL="${AUTO_APPROVE_HITL:-1}"
export EXAMPLES_CONCURRENCY="${EXAMPLES_CONCURRENCY:-4}"
export EXAMPLES_EXECA_TIMEOUT_MS="${EXAMPLES_EXECA_TIMEOUT_MS:-300000}"
export EXAMPLES_INCLUDE_INTERACTIVE="${EXAMPLES_INCLUDE_INTERACTIVE:-1}"
export EXAMPLES_INCLUDE_SERVER="${EXAMPLES_INCLUDE_SERVER:-0}"
export EXAMPLES_INCLUDE_AUDIO="${EXAMPLES_INCLUDE_AUDIO:-0}"
export EXAMPLES_INCLUDE_EXTERNAL="${EXAMPLES_INCLUDE_EXTERNAL:-0}"
cd "$ROOT"
run_examples_preflight
run_examples_start "$@"
}
cmd_start() {
ensure_dirs
local background=0
if [[ "${1:-}" == "--background" ]]; then
background=1
shift
fi
local ts log_file
ts="$(date +%Y%m%d-%H%M%S)"
log_file="$LOG_DIR/main_${ts}.log"
if [[ "$background" -eq 1 ]]; then
if [[ -f "$PID_FILE" ]]; then
local pid
pid="$(cat "$PID_FILE" 2>/dev/null || true)"
if is_running "$pid"; then
echo "examples:start-all already running (pid=$pid)."
exit 1
fi
fi
(
trap '' HUP
start_runner "$log_file" "$@" 2>&1 | tee "$log_file" >/dev/null
) &
local pid=$!
echo "$pid" >"$PID_FILE"
echo "Started examples:start-all (pid=$pid)"
echo "Log: $log_file"
return 0
fi
start_runner "$log_file" "$@" 2>&1 | tee "$log_file"
return $?
}
cmd_stop() {
if [[ ! -f "$PID_FILE" ]]; then
echo "No pid file; nothing to stop."
return 0
fi
local pid
pid="$(cat "$PID_FILE" 2>/dev/null || true)"
if [[ -z "$pid" ]]; then
rm -f "$PID_FILE"
echo "Pid file empty; cleaned."
return 0
fi
if ! is_running "$pid"; then
rm -f "$PID_FILE"
echo "Process $pid not running; cleaned pid file."
return 0
fi
echo "Stopping pid $pid ..."
kill "$pid" 2>/dev/null || true
sleep 1
if is_running "$pid"; then
echo "Sending SIGKILL to $pid ..."
kill -9 "$pid" 2>/dev/null || true
fi
rm -f "$PID_FILE"
echo "Stopped."
}
cmd_status() {
if [[ -f "$PID_FILE" ]]; then
local pid
pid="$(cat "$PID_FILE" 2>/dev/null || true)"
if is_running "$pid"; then
echo "Running (pid=$pid)"
return 0
fi
fi
echo "Not running."
}
cmd_logs() {
ensure_dirs
ls -1t "$LOG_DIR"
}
cmd_tail() {
ensure_dirs
local file="$1"
if [[ -z "${file:-}" ]]; then
file="$(ls -1t "$LOG_DIR" | head -n1)"
fi
if [[ -z "$file" ]]; then
echo "No log files yet."
exit 1
fi
tail -f "$LOG_DIR/$file"
}
collect_rerun() {
ensure_dirs
local log_file="${1:-}"
if [[ -z "$log_file" ]]; then
log_file="$(ls -1t "$LOG_DIR"/main_*.log 2>/dev/null | head -n1)"
fi
if [[ -z "$log_file" ]] || [[ ! -f "$log_file" ]]; then
echo "No main log file found."
exit 1
fi
node scripts/run-example-starts.mjs --collect "$log_file" --output "$RERUN_FILE"
}
rerun_list() {
ensure_dirs
local include_server="${EXAMPLES_INCLUDE_SERVER:-0}"
local include_audio="${EXAMPLES_INCLUDE_AUDIO:-0}"
local include_interactive="${EXAMPLES_INCLUDE_INTERACTIVE:-0}"
local include_external="${EXAMPLES_INCLUDE_EXTERNAL:-0}"
local interactive_mode="${EXAMPLES_INTERACTIVE_MODE:-auto}"
local file="${1:-$RERUN_FILE}"
if [[ ! -f "$file" ]]; then
echo "Rerun list not found: $file"
exit 1
fi
# same keywords as scripts/run-example-starts.mjs
# Simplified tag detection aligned with start: interactiveは特別扱いしない
local -a server_keywords=("realtime" "nextjs" "server" "vite" "next")
local -a audio_keywords=("realtime" "voice" "audio")
local -a external_keywords=("prisma" "redis" "twilio" "dapr" "playwright")
load_auto_skip() {
node --input-type=module - "$ROOT" <<'NODE'
import path from 'node:path';
import { pathToFileURL } from 'node:url';
const rootDir = process.argv[2];
const { loadAutoSkip, DEFAULT_AUTO_SKIP } = await import(pathToFileURL(path.join(rootDir, 'scripts', 'run-example-starts.mjs')));
const set = loadAutoSkip ? loadAutoSkip() : new Set(DEFAULT_AUTO_SKIP);
for (const item of [...set]) {
console.log(item);
}
NODE
}
load_auto_input() {
local name="$1"
node --input-type=module - "$ROOT" "$name" <<'NODE'
import path from 'node:path';
import { pathToFileURL } from 'node:url';
const [rootDir, key] = process.argv.slice(2);
const { DEFAULT_INTERACTIVE_INPUTS } = await import(
pathToFileURL(path.join(rootDir, 'scripts', 'run-example-starts.mjs'))
);
const input =
DEFAULT_INTERACTIVE_INPUTS.get(key) ??
process.env.EXAMPLES_INTERACTIVE_DEFAULT_INPUT ??
'';
process.stdout.write(input);
NODE
}
local -a auto_skip_list=()
while IFS= read -r auto_skip_entry; do
[[ -z "$auto_skip_entry" ]] && continue
auto_skip_list+=("$auto_skip_entry")
done < <(load_auto_skip | awk NF)
has_keyword() {
local name="$1"; shift
local kw
for kw in "$@"; do
if [[ "$name" == *"$kw"* ]]; then
return 0
fi
done
return 1
}
detect_tags() {
local name="$1"
local tags=()
if has_keyword "$name" "${server_keywords[@]}"; then tags+=("server"); fi
if has_keyword "$name" "${audio_keywords[@]}"; then tags+=("audio"); fi
if has_keyword "$name" "${external_keywords[@]}"; then tags+=("external"); fi
printf '%s\n' "${tags[@]:-}"
}
should_skip() {
local name="$1"
local tags
tags="$(detect_tags "$name")"
local t
for t in $tags; do
case "$t" in
server) [[ "$include_server" == "1" ]] || { echo "Skipping $name (server). Set EXAMPLES_INCLUDE_SERVER=1 to run."; return 0; } ;;
audio) [[ "$include_audio" == "1" ]] || { echo "Skipping $name (audio). Set EXAMPLES_INCLUDE_AUDIO=1 to run."; return 0; } ;;
external) [[ "$include_external" == "1" ]] || { echo "Skipping $name (external). Set EXAMPLES_INCLUDE_EXTERNAL=1 to run."; return 0; } ;;
esac
done
return 1
}
local -a remaining=()
exec 3<"$file"
while IFS= read -r entry <&3; do
[[ -z "$entry" ]] && continue
IFS=':' read -r pkg rest <<<"$entry"
script="$rest"
if [[ -z "$pkg" || -z "$script" ]]; then
echo "Skipping invalid entry: $entry"
continue
fi
local full="${pkg}:${script}"
local skip_auto=0
for a in "${auto_skip_list[@]}"; do
if [[ "$full" == "$a" ]]; then
skip_auto=1
break
fi
done
if [[ $skip_auto -eq 1 ]]; then
echo "Skipping $full (auto-skip list)."
continue
fi
if should_skip "$full"; then
remaining+=("$entry")
continue
fi
log_name="${pkg}__${script//:/-}.rerun.log"
echo ">>> Rerunning $pkg:${script}"
local auto_input=""
if [[ "$interactive_mode" == "auto" ]]; then
auto_input="$(load_auto_input "$full")"
if [[ -n "$auto_input" ]]; then
echo "[auto-input enabled]"
fi
fi
if (
cd "$ROOT"
export EXAMPLES_INTERACTIVE_MODE="${EXAMPLES_INTERACTIVE_MODE:-auto}"
export AUTO_APPROVE_MCP="${AUTO_APPROVE_MCP:-1}"
export APPLY_PATCH_AUTO_APPROVE="${APPLY_PATCH_AUTO_APPROVE:-1}"
export AUTO_APPROVE_HITL="${AUTO_APPROVE_HITL:-1}"
export SHELL_AUTO_APPROVE="${SHELL_AUTO_APPROVE:-1}"
{
if [[ -n "$auto_input" ]]; then
{ printf '%s' "$auto_input"; printf '\n'; } | pnpm -C "examples/$pkg" run "${script}"
rc=${PIPESTATUS[1]}
else
pnpm -C "examples/$pkg" run "${script}"
rc=$?
fi
} 2>&1 | tee "$LOG_DIR/$log_name"
rc=${PIPESTATUS[0]}
if [[ $rc -ne 0 ]]; then
echo "!!! Rerun failed: ${pkg}:${script} (exit $rc)"
exit $rc
fi
exit 0
); then
rc=0
else
rc=$?
fi
if [[ $rc -ne 0 ]]; then
remaining+=("$entry")
fi
done
exec 3<&-
# De-duplicate and persist remaining list
if [[ ${#remaining[@]} -gt 0 ]]; then
printf "%s\n" "${remaining[@]}" | awk '!seen[$0]++' >"$file"
echo "Updated rerun list with ${#remaining[@]} remaining entries."
else
: >"$file"
echo "All rerun entries completed successfully; rerun list cleared."
fi
}
usage() {
cat <<'EOF'
Usage: run.sh <start|stop|status|logs|tail|collect|rerun> [args...]
Commands:
start [--filter ... | other args] Start examples:start-all in background with auto mode.
stop Kill the running examples:start-all (if any).
status Show whether it is running.
logs List log files (.tmp/examples-start-logs).
tail [logfile] Tail the latest (or specified) log.
collect [main_log] Parse a main log and write non-passed examples to .tmp/examples-rerun.txt.
rerun [rerun_file] Run only the examples listed in .tmp/examples-rerun.txt (one per line: package:script).
Environment overrides:
EXAMPLES_CONCURRENCY (default 4)
EXAMPLES_EXECA_TIMEOUT_MS (default 300000)
EXAMPLES_INCLUDE_SERVER/INTERACTIVE/AUDIO/EXTERNAL (defaults: 0/1/0/0)
EXAMPLES_AUTO_SKIP (comma/space separated list; overrides built-in defaults)
EOF
}
# Decide default command
default_cmd="start"
if [[ $# -eq 0 && -s "$RERUN_FILE" ]]; then
default_cmd="rerun"
fi
case "${1:-$default_cmd}" in
start) shift || true; cmd_start "$@" ;;
stop) shift || true; cmd_stop ;;
status) shift || true; cmd_status ;;
logs) shift || true; cmd_logs ;;
tail) shift; cmd_tail "${1:-}" ;;
collect) shift || true; collect_rerun "${1:-}" ;;
rerun) shift || true; rerun_list "${1:-}" ;;
*) usage; exit 1 ;;
esac
Related skills
FAQ
What command is used?
examples:start-all in auto mode with parallel execution.
How are failures diagnosed?
Per-script logs captured during parallel execution.
What helpers exist?
Start and stop helper utilities for managing example runs.