Skip to content

Commit 12ecf38

Browse files
committed
docs(agents): harden gator launch examples
Signed-off-by: John Myers <johntmyers@users.noreply.github.com>
1 parent 5427f87 commit 12ecf38

1 file changed

Lines changed: 73 additions & 16 deletions

File tree

  • .agents/skills/launch-openshell-gator

.agents/skills/launch-openshell-gator/SKILL.md

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,91 +99,145 @@ openshell --gateway docker-dev sandbox list
9999

100100
Look for names like `gator-pr-<number>-supervised`. If one exists, inspect its log before deleting or relaunching.
101101

102+
## Input Normalization
103+
104+
Never paste raw operator text into shell arguments such as `--name`, `--from`, issue numbers, or PR numbers. Normalize values before constructing launch commands.
105+
106+
Use digits only for issue and PR numbers:
107+
108+
```bash
109+
pr_number="<digits-only>"
110+
[[ "$pr_number" =~ ^[0-9]+$ ]] || { echo "invalid PR number" >&2; exit 1; }
111+
```
112+
113+
Use a restricted sandbox-name character set:
114+
115+
```bash
116+
sandbox_name="gator-pr-${pr_number}-supervised"
117+
[[ "$sandbox_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid sandbox name" >&2; exit 1; }
118+
```
119+
120+
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.
121+
102122
## Standard Launches
103123

104124
### Launch A PR Watcher
105125

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

108128
```bash
129+
pr_number="<digits-only>"
130+
[[ "$pr_number" =~ ^[0-9]+$ ]] || { echo "invalid PR number" >&2; exit 1; }
131+
sandbox_name="gator-pr-${pr_number}-supervised"
132+
[[ "$sandbox_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid sandbox name" >&2; exit 1; }
133+
109134
./scripts/agents/run.sh \
110135
--agent gator \
111136
--gateway docker-dev \
112-
--name gator-pr-<pr>-supervised \
137+
--name "$sandbox_name" \
113138
--watch \
114139
--background \
115-
"Review and monitor PR #<pr> through the gator-gate workflow. Scope this invocation only to PR #<pr>."
140+
"Review and monitor PR #${pr_number} through the gator-gate workflow. Scope this invocation only to PR #${pr_number}."
116141
```
117142

118143
The launcher builds the gator sandbox image when needed, stages the immutable payload, imports provider profiles, configures provider credentials and refresh, creates the sandbox, and writes a background log under `scripts/agents/gator/logs/`.
119144

120145
### Launch An Issue Or Issue/PR Pair
121146

122147
```bash
148+
issue_number="<digits-only>"
149+
[[ "$issue_number" =~ ^[0-9]+$ ]] || { echo "invalid issue number" >&2; exit 1; }
150+
sandbox_name="gator-issue-${issue_number}-supervised"
151+
[[ "$sandbox_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid sandbox name" >&2; exit 1; }
152+
123153
./scripts/agents/run.sh \
124154
--agent gator \
125155
--gateway docker-dev \
126-
--name gator-issue-<issue>-supervised \
156+
--name "$sandbox_name" \
127157
--watch \
128158
--background \
129-
"Run gator on issue #<issue>. Scope this invocation only to issue #<issue>."
159+
"Run gator on issue #${issue_number}. Scope this invocation only to issue #${issue_number}."
130160
```
131161

132162
For a linked pair:
133163

134164
```bash
165+
pr_number="<digits-only>"
166+
issue_number="<digits-only>"
167+
[[ "$pr_number" =~ ^[0-9]+$ ]] || { echo "invalid PR number" >&2; exit 1; }
168+
[[ "$issue_number" =~ ^[0-9]+$ ]] || { echo "invalid issue number" >&2; exit 1; }
169+
sandbox_name="gator-pr-${pr_number}-supervised"
170+
[[ "$sandbox_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid sandbox name" >&2; exit 1; }
171+
135172
./scripts/agents/run.sh \
136173
--agent gator \
137174
--gateway docker-dev \
138-
--name gator-pr-<pr>-supervised \
175+
--name "$sandbox_name" \
139176
--watch \
140177
--background \
141-
"Review and monitor PR #<pr> with linked issue #<issue> through the gator-gate workflow. Scope this invocation only to PR #<pr> and issue #<issue>."
178+
"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}."
142179
```
143180

144181
### Launch With Explicit Maintainer Authorization
145182

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

148185
```bash
186+
pr_number="<digits-only>"
187+
[[ "$pr_number" =~ ^[0-9]+$ ]] || { echo "invalid PR number" >&2; exit 1; }
188+
sandbox_name="gator-pr-${pr_number}-supervised"
189+
[[ "$sandbox_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid sandbox name" >&2; exit 1; }
190+
149191
./scripts/agents/run.sh \
150192
--agent gator \
151193
--gateway docker-dev \
152-
--name gator-pr-<pr>-supervised \
194+
--name "$sandbox_name" \
153195
--watch \
154196
--background \
155-
"Review and monitor PR #<pr> through the gator-gate workflow. Scope this invocation only to PR #<pr>. The operator explicitly authorizes applying the test:e2e label and posting /ok to test for the current head SHA if gator determines that is required."
197+
"Review and monitor PR #${pr_number} through the gator-gate workflow. Scope this invocation only to PR #${pr_number}. The operator explicitly authorizes applying the test:e2e label and posting /ok to test for the current head SHA if gator determines that is required."
156198
```
157199

158200
## Model Or Image Experiments
159201

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

162204
```bash
205+
pr_number="<digits-only>"
206+
[[ "$pr_number" =~ ^[0-9]+$ ]] || { echo "invalid PR number" >&2; exit 1; }
207+
sandbox_name="gator-pr-${pr_number}-gpt56sol-supervised"
208+
[[ "$sandbox_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid sandbox name" >&2; exit 1; }
209+
163210
CODEX_MODEL=gpt-5.6-sol \
164211
./scripts/agents/run.sh \
165212
--agent gator \
166213
--gateway docker-dev \
167-
--name gator-pr-<pr>-gpt56sol-supervised \
214+
--name "$sandbox_name" \
168215
--watch \
169216
--background \
170-
"Review and monitor PR #<pr> through the gator-gate workflow. Scope this invocation only to PR #<pr>. This launch is intentionally testing Codex model gpt-5.6-sol via the CLI launcher."
217+
"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."
171218
```
172219

173-
If the installed Codex CLI is too old for a model, create a temporary copy of `scripts/agents/gator/` under `/var/folders/52/ygrbs0zn7pxgfcppwggvgklm0000gp/T/opencode` or another approved temp directory, adjust only that temporary Dockerfile, and launch with `--from <temp-context>`. Keep the repo Dockerfile unchanged unless the version bump is the intended code change.
220+
If the installed Codex CLI is too old for a model, create a temporary copy of `scripts/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.
174221

175222
Example shape:
176223

177224
```bash
225+
pr_number="<digits-only>"
226+
[[ "$pr_number" =~ ^[0-9]+$ ]] || { echo "invalid PR number" >&2; exit 1; }
227+
sandbox_name="gator-pr-${pr_number}-gpt56sol-supervised"
228+
[[ "$sandbox_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid sandbox name" >&2; exit 1; }
229+
tmp_context="$(mktemp -d "${TMPDIR:-/tmp}/gator-codex-XXXXXX")"
230+
cp -R scripts/agents/gator/. "$tmp_context"/
231+
178232
CODEX_MODEL=gpt-5.6-sol \
179233
./scripts/agents/run.sh \
180234
--agent gator \
181235
--gateway docker-dev \
182-
--name gator-pr-<pr>-gpt56sol-supervised \
183-
--from /var/folders/52/ygrbs0zn7pxgfcppwggvgklm0000gp/T/opencode/gator-codex-<version> \
236+
--name "$sandbox_name" \
237+
--from "$tmp_context" \
184238
--watch \
185239
--background \
186-
"Review and monitor PR #<pr> through the gator-gate workflow. Scope this invocation only to PR #<pr>."
240+
"Review and monitor PR #${pr_number} through the gator-gate workflow. Scope this invocation only to PR #${pr_number}."
187241
```
188242

189243
## Monitoring
@@ -231,11 +285,14 @@ Restart when the payload must change, the sandbox is wedged without a sentinel,
231285
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.
232286

233287
```bash
234-
openshell --gateway docker-dev sandbox delete <sandbox-name>
288+
sandbox_name="<safe-sandbox-name>"
289+
[[ "$sandbox_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid sandbox name" >&2; exit 1; }
290+
291+
openshell --gateway docker-dev sandbox delete "$sandbox_name"
235292
./scripts/agents/run.sh \
236293
--agent gator \
237294
--gateway docker-dev \
238-
--name <sandbox-name> \
295+
--name "$sandbox_name" \
239296
--watch \
240297
--background \
241298
"<same scoped operator prompt, updated only with the reason for relaunch>"

0 commit comments

Comments
 (0)