Launch openshell gator

From NVIDIA/OpenShell · View interactive version

Launch openshell gator is an AI agent skill from the GitHub repository NVIDIA/OpenShell. Launch and supervise OpenShell gator agents. Use when starting gator on issues or PRs, checking gator sandboxes, building the gator sandbox image, restarting stuck gators, inspecting gator logs, or experimenting with gator harness/model overrides. Trigger keywords - launch gator, start gator, run ga

How to use this skill

Skill file

Launch OpenShell Gator

Launch and supervise the repository's headless gator sandbox agent through OpenShell. This skill covers the operator workflow around .agents/agents/gator/run.sh; the in-sandbox review and state-machine policy remains the gator-gate skill baked into the gator payload.

For gator's PR/issue validation policy, load gator-gate inside the launched sandbox. For generic sandbox CLI usage, use openshell-cli. For unhealthy gateways or sandbox startup failures, use debug-openshell-cluster after the launch preflight identifies a gateway/runtime problem.

Non-Negotiable Rules

Key Paths

| Path | Purpose |

|---|---|

| .agents/agents/gator/run.sh | Manifest-driven OpenShell agent launcher. |

| .agents/agents/gator/agent.yaml | Gator manifest: immutable payload version, default gateway, harness, providers, runtime, skills, and subagents. |

| .agents/agents/gator/Dockerfile | Gator sandbox image source. Local launches build it in gateway's Docker or Podman image store. |

| .agents/agents/gator/policy.yaml | Sandbox policy for the gator agent. |

| .agents/agents/gator/bin/gh | Gator-specific gh wrapper and same-SHA duplicate-post guard. |

| .agents/agents/gator/bin/review-feedback-ledger | Builds tree-aware review scope, durable findings, convergence telemetry, and review-budget state. |

| .agents/agents/gator/bin/resolve-gator-review-threads | Resolves addressed Gator-owned inline review threads by ledger finding ID. |

| .agents/agents/gator/bin/validate-review-findings | Enforces the blocker evidence schema and downgrades unsupported hypotheses. |

| .agents/agents/gator/prompts/gator.md | Rendered top-level prompt template baked into the payload. |

| .agents/agents/gator/skills/gator-gate/SKILL.md | In-sandbox gator state-machine skill. |

Preflight

Run these checks before launching unless the operator asks for a best-effort launch.

Step 1: Confirm Repository Root

git rev-parse --show-toplevel
git status --short --branch

Use the repository root as the working directory for all commands. A dirty worktree is allowed, but do not stage or modify unrelated files.

Step 2: Verify Required Host Tools

command -v openshell
command -v gh
command -v jq
command -v ruby

The local openshell wrapper may recompile the CLI. If that fails, fix the local build or ask the operator before changing unrelated source.

Step 3: Verify GitHub Auth

Use gh api user as the health check. It works with provider-scoped tokens and matches gator's own auth guidance.

gh api user --jq '.login'
gh api repos/ai-openshell/openshell --jq '{full_name,default_branch}'

If this fails, refresh host gh auth before launching. Do not rely on gh auth status alone inside provider-backed sandboxes.

Step 4: Verify Codex Auth For Codex Harness

The default gator harness is Codex. Check that the host has usable Codex auth material:

jq -e '.tokens.access_token and .tokens.refresh_token and .tokens.account_id' "$HOME/.codex/auth.json" >/dev/null

If this fails, run the local Codex login flow outside the gator launch. If Codex was recently reauthenticated and gateway refresh fails later, relaunch with --reset-refresh once.

The launcher passes the non-secret host account ID as literal CODEX_ACCOUNT_ID for Codex's local workspace routing. The harness must not use the opaque CODEX_AUTH_ACCOUNT_ID credential placeholder for that comparison. Access tokens remain placeholders, and refresh material remains gateway-only.

The image contains task-independent tooling and a prompt template, not the run's PR assignment or test authorization. The launcher supplies those instructions at runtime through OPENSHELL_AGENT_TASK in the canonical process command. The supervisor captures the assembled prompt in memory and supplies it on stdin for every cycle. Task text is non-secret and may appear in runtime command metadata; never put credentials in the task. Task-only changes reuse the same tooling build inputs, although the launcher still builds/tags an image per invocation.

For Kubernetes gateways, select image delivery explicitly: --k3d-cluster NAME

builds with Docker and imports into a running local cluster with the matching

current kube context; --publish-image REGISTRY/REPOSITORY:TAG builds and pushes,

then launches by resolved digest; --image REGISTRY/REPOSITORY@sha256:DIGEST

reuses trusted compatible tooling without local image tools. Do not infer

locality from a loopback endpoint. The k3d selection asserts which cluster

serves the gateway; imported images require if_not_present or never pull

policy. Registry builds use the builder's platform and existing registry auth;

nodes need their own pull access. --build-only builds/delivers without

gateway mutations, provider credential reads, or a sandbox launch. Reused

images must match the local manifest's agent ID and payload version and support

the runtime task contract; legacy baked-task images fail startup. See

.agents/agents/gator/README.md for examples and option compatibility.

Step 5: Verify Gateway Is Registered And Alive

Use the target gateway from the operator request or current session context. Do not assume a gateway name. If the operator did not specify one, list registered gateways and ask before launching when the correct target is ambiguous.

openshell gateway list

gateway_name="<selected-gateway-name>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }

openshell --gateway "$gateway_name" status
openshell --gateway "$gateway_name" sandbox list

Expected result: status returns successfully and sandbox listing completes. If the gateway is unreachable, the runtime cannot create sandboxes, or sandbox listing hangs, switch to debug-openshell-cluster and fix the gateway before launching gator.

Step 6: Check Existing Gator Sandboxes

Avoid duplicate gators for the same PR unless intentionally replacing a stuck or stale one.

gateway_name="<selected-gateway-name>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }

openshell --gateway "$gateway_name" sandbox list

Look for names like gtr-pr-<number>-watch. If one exists, inspect its log before deleting or relaunching.

Input Normalization

Never paste raw operator text into shell arguments such as --gateway, --name, --from, issue numbers, or PR numbers. Normalize values before constructing launch commands.

Use the operator-specified gateway or a gateway selected from openshell gateway list:

gateway_name="<selected-gateway-name>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }

Use digits only for issue and PR numbers:

pr_number="<digits-only>"
[[ "$pr_number" =~ ^[0-9]+$ ]] || { echo "invalid PR number" >&2; exit 1; }

Sandbox names must be DNS-1123 labels of at most 19 characters, including

any suffix. The gateway reserves room for workspace, sandbox, and service

segments in one DNS label; this limit applies to every compute driver. Use

short names and validate them before launching:

sandbox_name="gtr-pr-${pr_number}-watch"
[[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; }

For local image contexts passed to --from, use an agent-created path such as mktemp -d; do not pass raw user-supplied paths without validating that they are expected local Dockerfile contexts.

Standard Launches

Launch A PR Watcher

Use a stable, scoped name and a prompt that names exactly what gator should do.

gateway_name="<selected-gateway-name>"
pr_number="<digits-only>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }
[[ "$pr_number" =~ ^[0-9]+$ ]] || { echo "invalid PR number" >&2; exit 1; }
sandbox_name="gtr-pr-${pr_number}-watch"
[[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; }

./.agents/agents/gator/run.sh \
  --gateway "$gateway_name" \
  --name "$sandbox_name" \
  --watch \
  "Review and monitor PR #${pr_number} through the gator-gate workflow. Scope this invocation only to PR #${pr_number}."

The launcher queries the gateway's selected compute driver and prepares the image through the selected build/import/publish or prebuilt path before importing provider profiles, configuring provider credentials and refresh, and starting the agent supervisor as the sandbox's canonical main process. The detached main process survives loss of the host CLI connection and reconnects to a restarted gateway. Unless --keep is set, the sandbox is marked ephemeral so the gateway deletes it after the canonical main process exits and its terminal result is finalized. CONTAINER_ENGINE, when set, must match Docker/Podman gateways or Docker for k3d imports; registry builds for Kubernetes may use either local engine.

The launcher streams image-build and provisioning output until the detached workload is ready, then exits. Use openshell logs <sandbox-name> or the TUI for runtime output.

Launch An Issue Or Issue/PR Pair

gateway_name="<selected-gateway-name>"
issue_number="<digits-only>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }
[[ "$issue_number" =~ ^[0-9]+$ ]] || { echo "invalid issue number" >&2; exit 1; }
sandbox_name="gtr-i-${issue_number}-watch"
[[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; }

./.agents/agents/gator/run.sh \
  --gateway "$gateway_name" \
  --name "$sandbox_name" \
  --watch \
  "Run gator on issue #${issue_number}. Scope this invocation only to issue #${issue_number}."

For a linked pair:

gateway_name="<selected-gateway-name>"
pr_number="<digits-only>"
issue_number="<digits-only>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }
[[ "$pr_number" =~ ^[0-9]+$ ]] || { echo "invalid PR number" >&2; exit 1; }
[[ "$issue_number" =~ ^[0-9]+$ ]] || { echo "invalid issue number" >&2; exit 1; }
sandbox_name="gtr-pr-${pr_number}-watch"
[[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; }

./.agents/agents/gator/run.sh \
  --gateway "$gateway_name" \
  --name "$sandbox_name" \
  --watch \
  "Review and monitor PR #${pr_number} with linked issue #${issue_number} through the gator-gate workflow. Scope this invocation only to PR #${pr_number} and issue #${issue_number}."

Launch With Explicit Maintainer Authorization

Only include authorization in the prompt when the operator explicitly gave it.

gateway_name="<selected-gateway-name>"
pr_number="<digits-only>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }
[[ "$pr_number" =~ ^[0-9]+$ ]] || { echo "invalid PR number" >&2; exit 1; }
sandbox_name="gtr-pr-${pr_number}-watch"
[[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; }

./.agents/agents/gator/run.sh \
  --gateway "$gateway_name" \
  --name "$sandbox_name" \
  --watch \
  "Review and monitor PR #${pr_number} in ai-openshell/openshell through the gator-gate workflow. Scope this invocation only to PR #${pr_number}. The operator explicitly authorizes applying relevant test labels and approving current-head GitHub Actions workflow runs through approve-gator-workflow. Do not approve PRs, merge, push, rerun workflows, or dispatch workflows."

Native GitHub Actions approval replaces /ok to test; a test label selects the

suite but does not approve an external contributor's run. The guarded helper

refuses PRs changing .github/, which need manual inspection and approval.

Do not reuse an old launch assignment's /ok to test authorization as permission

to approve workflow runs. Request explicit workflow-approval authorization.

When payload 15 is published, replace still-active older watchers after checking

their current state. Baked skills cannot update in place. Keep private-advisory

watchers scoped to their private repository and review-only authorization.

Model Or Image Experiments

Use environment overrides. Do not edit agent.yaml for temporary experiments.

gateway_name="<selected-gateway-name>"
pr_number="<digits-only>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }
[[ "$pr_number" =~ ^[0-9]+$ ]] || { echo "invalid PR number" >&2; exit 1; }
sandbox_name="gtr-pr-${pr_number}-exp"
[[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; }

CODEX_MODEL=gpt-5.6-sol \
./.agents/agents/gator/run.sh \
  --gateway "$gateway_name" \
  --name "$sandbox_name" \
  --watch \
  "Review and monitor PR #${pr_number} through the gator-gate workflow. Scope this invocation only to PR #${pr_number}. This launch is intentionally testing Codex model gpt-5.6-sol via the CLI launcher."

If the installed Codex CLI is too old for a model, create a temporary copy of .agents/agents/gator/, adjust only that temporary Dockerfile, and launch with that generated context. Keep the repo Dockerfile unchanged unless the version bump is the intended code change.

The short -exp suffix below identifies an experimental watcher; keep its full

name within 19 characters.

Example shape:

gateway_name="<selected-gateway-name>"
pr_number="<digits-only>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }
[[ "$pr_number" =~ ^[0-9]+$ ]] || { echo "invalid PR number" >&2; exit 1; }
sandbox_name="gtr-pr-${pr_number}-exp"
[[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; }
tmp_context="$(mktemp -d "${TMPDIR:-/tmp}/gator-codex-XXXXXX")"
cp -R .agents/agents/gator/. "$tmp_context"/

CODEX_MODEL=gpt-5.6-sol \
./.agents/agents/gator/run.sh \
  --gateway "$gateway_name" \
  --name "$sandbox_name" \
  --from "$tmp_context" \
  --watch \
  "Review and monitor PR #${pr_number} through the gator-gate workflow. Scope this invocation only to PR #${pr_number}."

Monitoring

Read The Launch Result

The launcher streams image-build and provisioning output to the terminal. Important markers:

size-limited full-diff endpoint. An unavailable patch ID alone does not block

the ledger; it disables rebase-equivalence shortcuts. Reviewers should inspect

oversized changes file-by-file locally.

in its normal review findings. Private follow-up under SECURITY.md is for

pre-existing vulnerabilities independent of the PR; security classification

alone is not a private-triage or test-dispatch gate. Gator must not initiate

external security reporting without explicit operator authorization.

Inspect Active Sandboxes

gateway_name="<selected-gateway-name>"
sandbox_name="<safe-sandbox-name>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }
[[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; }

openshell --gateway "$gateway_name" sandbox list
openshell --gateway "$gateway_name" sandbox get "$sandbox_name"

If sandbox get is not supported by the local CLI shape, use openshell sandbox --help and follow the current command help.

Interpret Common Sentinels

| Sentinel | Meaning | Operator action |

|---|---|---|

| status=waiting | Normal watch wait. | Leave sandbox running. |

| status=blocked | Human/process blocker. | Read reason; decide whether a human action is needed. |

| status=transient_failure | Retryable infrastructure/auth/transport issue. | Let supervisor retry unless repeated failures hit the configured cap. |

| status=terminal_failure | Unrecoverable or stale immutable payload. | Inspect the reason; rebuild/relaunch for stale_gator_payload. |

| status=complete | Target closed, merged, or one-shot complete. | Delete sandbox if no longer needed. |

Prefer the state snapshot over scraping transient /tmp cycle output. Use the

history file to tell whether a failure is repeating or whether the supervisor

has begun a fresh cycle. Runtime logs remain useful for full command output and

transport diagnostics.

Restarting A Gator

Restart when the payload must change, the sandbox is wedged without a sentinel, the model/tooling version changed, or a transient failure repeats past the useful retry point.

Increment payload_version in .agents/agents/gator/agent.yaml whenever a

merged change alters the Gator prompt, gate skill, reviewer contract, write

guard, ledger, thread resolver, or bundled validator. Existing immutable

watchers cannot replace their own payload. New-version watchers detect later

published versions and stop with stale_gator_payload; relaunch every

still-active older watcher after the version bump is published.

Before deleting, check that the sandbox is truly stale or that the operator asked for a restart. If a bounded review cycle is actively running and still producing useful output, prefer leaving it alone.

gateway_name="<selected-gateway-name>"
sandbox_name="<safe-sandbox-name>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }
[[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; }

openshell --gateway "$gateway_name" sandbox delete "$sandbox_name"
./.agents/agents/gator/run.sh \
  --gateway "$gateway_name" \
  --name "$sandbox_name" \
  --watch \
  "<same scoped operator prompt, updated only with the reason for relaunch>"

When relaunching after a same-SHA infrastructure failure, say that the prior attempt failed before producing a valid review disposition. When relaunching after a draft-only blocker cleared, say that the prior same-SHA disposition was only a draft blocker and the PR is now ready for review.

Troubleshooting

Gateway Unreachable

Symptoms: openshell status fails, sandbox list fails, sandbox remains pending, image build never starts.

Action: load debug-openshell-cluster and diagnose the gateway/driver. Do not keep retrying gator launches against a dead gateway.

Image Build Failure

Symptoms: Dockerfile step failure, missing package, incompatible Codex CLI, registry pull failure.

Actions:

Provider Or Credential Failure

Symptoms: host gh auth fails, Codex refresh fails, in-sandbox GitHub calls report auth failures, reviewer_subagent_failed repeats due Codex auth.

Actions:

Unsupported `gh pr view --json` Field

Gator may recover by using supported gh pr view fields plus REST calls. If it does not, patch the gator prompt or skill to avoid the unsupported field, validate, commit, and relaunch with the updated payload.

Same-SHA Duplicate Guard Blocks A Needed Comment

The wrapper intentionally blocks duplicate same-head-SHA gator dispositions. A relaunch should not post again for the same SHA unless one of these applies:

the pending human action, but it must not repeat the review disposition or

trigger another reviewer run.

Do not bypass with OPENSHELL_GATOR_ALLOW_SAME_SHA_COMMENT=1 unless the operator explicitly confirms a maintainer override.

Reporting Back

When you launch or inspect gator, report:

Keep the report concise. Include exact commands only when they help the operator reproduce or continue the workflow.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.