Skip to content

Commit be9ce37

Browse files
authored
chore: add runtime behavior probe skill (#2743)
1 parent 49f593b commit be9ce37

File tree

7 files changed

+862
-0
lines changed

7 files changed

+862
-0
lines changed
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
---
2+
name: runtime-behavior-probe
3+
description: Plan and execute runtime-behavior investigations with temporary probe scripts, validation matrices, state controls, and findings-first reports. Use only when the user explicitly invokes this skill to verify actual runtime behavior beyond normal code-level checks, especially to uncover edge cases, undocumented behavior, or common failure modes in local or live integrations. A baseline smoke check is fine as an entry point, but do not stop at happy-path confirmation.
4+
---
5+
6+
# Runtime Behavior Probe
7+
8+
## Overview
9+
10+
Use this skill to investigate real runtime behavior, not to restate code or documentation. Start by planning the investigation, then execute a case matrix, record observed behavior, and report both the findings and the method used to obtain them.
11+
12+
## Core Rules
13+
14+
- Treat this skill as manual-only. Do not rely on implicit invocation.
15+
- A baseline success or smoke case is often the right entry point, but do not stop there when the real question involves edge cases, drift, or failure behavior.
16+
- Plan before running anything. Write the case matrix first, then fill it in with observed results. The matrix can live in a scratch note, a temporary file, or the probe script header.
17+
- Default to local or read-only probes. Consider a live service only when it is clearly relevant, then apply the lightweight gates below before you run it.
18+
- Size the probe to the decision. Start with the smallest matrix that can disqualify or validate the current hypothesis, then expand only when uncertainty remains.
19+
- Before a live probe, apply three lightweight gates:
20+
- Destination gate. Use only a live destination that is clearly allowed for the task.
21+
- Intent gate. Run the live probe only when the user explicitly wants runtime verification on that integration, or explicitly approves it after you propose the probe.
22+
- Data gate. If the probe will read environment variables, mutate remote state, incur material cost, or exercise non-public or user data, name the exact variable names or data class and get explicit approval first.
23+
- Classify each case as read-only, mutating, or costly before execution. For mutating or costly cases, or for any live case that will read environment variables, define cleanup or rollback before running the probe.
24+
- Use temporary files or a temporary directory for one-off probe scripts.
25+
- Keep temporary artifacts until the final response is drafted. Then delete them by default unless the user asked to keep them or they are needed for follow-up. Even when artifacts are deleted, keep a short run summary of the command shape, runtime context, and artifact status in the report.
26+
- Before executing a live probe that will read environment variables, tell the user the exact variable names you plan to use and why, then wait for explicit approval. Examples include `OPENAI_API_KEY` and other expected default names for the system under test.
27+
- Never print secrets, even when they come from standard environment variables that this skill may use.
28+
- For OpenAI API or OpenAI platform probes in this repository, use [$openai-knowledge](../openai-knowledge/SKILL.md) early to confirm contract-sensitive details such as supported parameters, field names, and limits. Use runtime probing to validate or challenge the documented behavior, not to skip the documentation pass entirely. If the docs MCP is unavailable, fall back to the official OpenAI docs and say that you used the fallback in the report.
29+
- For benchmark or comparison probes, make parity explicit before execution. Record what is held constant, what variable is under test, which response-shape constraints keep the comparison fair, and any usage or token counters that matter for interpreting latency or cost.
30+
- For OpenAI hosted tool probes, remove setup ambiguity before attributing a negative result to runtime behavior:
31+
- Force the tool path with the matching `tool_choice` when the question depends on tool invocation.
32+
- Treat `container_auto` and `container_reference` as separate cases, not interchangeable setup details.
33+
- Clear unsupported model or tool options first so they do not invalidate the probe.
34+
35+
## Workflow
36+
37+
1. Restate the investigation target in operational terms. Name the runtime surface, the key uncertainty, and the highest-risk behaviors to test.
38+
2. Do a short preflight. Check the relevant code or docs first, decide whether the question needs local or live validation, and note any repo, baseline, or release boundary that matters.
39+
3. Create a validation matrix before executing probes. Cover both baseline behavior and the most relevant failure or drift cases. The matrix can live in a scratch note, a temporary file, or a structured header inside the probe script.
40+
4. For each case, choose an execution mode up front:
41+
- `single-shot` for deterministic one-run checks.
42+
- `repeat-N` for cache, retry, streaming, interruption, rate-limit, concurrency, or other run-to-run-sensitive behavior.
43+
- `warm-up + repeat-N` when first-run cold-start effects could distort the result.
44+
Use these defaults unless the task clearly needs something else:
45+
- Quick screen of a repeat-sensitive question: `repeat-3`.
46+
- Decision-grade latency or release recommendation: `warm-up + repeat-10`.
47+
- Costly live cases: start at `repeat-3`, then expand only if the answer remains unclear.
48+
If it is genuinely unclear whether extra runs are worth the time or cost, ask the user before expanding the probe.
49+
5. When the question is benchmark-like or comparative, run in phases. Start with a high-signal pilot matrix against a control, then expand only the surviving candidates or unresolved cases.
50+
6. If the question is about a suspected regression or behavior change, add at least one known-good control case such as `origin/main`, the latest release, or the same request without the suspected option.
51+
7. For comparative probes, define parity before execution. Record prompt or input shape, tool-choice setup, model-settings parity, state reuse rules, and any response-shape constraint that keeps the comparison fair. If materially different output length could bias the result, record usage or token notes too.
52+
8. If the question asks whether one option has the same intelligence or quality as another, decide whether the matrix supports only example-pattern parity or a broader quality claim. For broader claims, add at least one harder or more open-ended case. Otherwise say explicitly that the result is limited to the covered patterns.
53+
9. Plan state controls before execution when hidden state could affect the result. Record whether each case uses fresh or reused state, how cache reuse or cache busting is handled, what unique IDs isolate repeated runs, and how cleanup is verified.
54+
10. If any live case will read environment variables, list the exact variable names and purpose for each case, then ask the user for approval before execution. Keep the approval ask short and include destination, read-only versus mutating or costly risk, exact variable names, and cleanup or rollback if relevant.
55+
11. Build task-specific probe scripts in a temporary location. Keep the script small, observable, and easy to discard.
56+
12. In `openai-agents-python`, make the runtime context explicit:
57+
- Run Python probes from the repository root with `uv run python` when practical.
58+
- Record the current commit, working directory, Python executable, and Python version.
59+
- Avoid accidental imports from a different checkout or site-packages location. If you must deviate from `uv run python`, say exactly why and what interpreter or environment was used instead.
60+
13. Execute the matrix and capture evidence. Record request shape, setup, observation summary, unexpected or negative result, error details, timing, runtime context, approved environment-variable names, repeat counts, warm-up handling, variance when relevant, cleanup behavior, and for comparisons note what was held constant plus any response-shape or usage notes that affect interpretation.
61+
14. Update the matrix with actual outcomes, not guesses.
62+
15. Keep temporary artifacts until the final response is drafted. Then delete them unless the user asked to keep them or they are needed for follow-up. Benchmark and repeat-heavy probes often need follow-up, so keeping artifacts is normal when the result may be revisited. If deleted, retain and report a short run summary.
63+
16. Report findings first, with unexpected or negative findings first. Then summarize how the validation was performed and which cases were covered.
64+
17. If the probe isolates one clear defect, you may include a short implementation hypothesis or minimal repro direction. Do not expand into a larger next-step plan unless the user asked for it.
65+
66+
## Validation Matrix
67+
68+
Use a matrix that makes the news easy to scan. Start from the runtime question and the observation summary, not just from `expected` and `pass` or `fail`.
69+
70+
Use a matrix with at least these columns:
71+
72+
- `case_id`
73+
- `scenario`
74+
- `mode`
75+
- `question`
76+
- `setup`
77+
- `observation_summary`
78+
- `result_flag`
79+
- `evidence`
80+
81+
Add these columns when they materially improve the investigation:
82+
83+
- `comparison_basis`
84+
- `variable_under_test`
85+
- `held_constant`
86+
- `output_constraint`
87+
- `status`
88+
- `confidence`
89+
- `state_setup`
90+
- `repeats`
91+
- `warm_up`
92+
- `variance`
93+
- `usage_note`
94+
- `risk_profile`
95+
- `env_vars`
96+
- `approval`
97+
- `control`
98+
99+
Treat `result_flag` as a fast scan field such as `unexpected`, `negative`, `expected`, or `blocked`. Use `status` only when there is a credible comparison basis, baseline, or documented contract to compare against.
100+
101+
Always consider whether the matrix should include these categories:
102+
103+
- Baseline success.
104+
- Control or baseline comparison when a regression is suspected.
105+
- Boundary input or parameter variation.
106+
- Invalid or unsupported input.
107+
- Missing or incorrect configuration.
108+
- Transient external failure such as timeout, network interruption, or rate limiting.
109+
- Retry, idempotence, or cleanup behavior.
110+
- Concurrency or overlapping operations when shared state or ordering may matter.
111+
- Open-ended quality or intelligence samples when the question is broader than pattern parity.
112+
113+
Open [validation-matrix.md](./references/validation-matrix.md) when you need a stronger prioritization model or a reusable case template.
114+
115+
## Temporary Probe Scripts
116+
117+
Write one-off scripts in a temporary file or temporary directory such as one created by `mktemp -d` or Python `tempfile`. Keep the script outside the repository by default, even when it imports code from the repository.
118+
119+
If the probe needs repository code:
120+
121+
- Run it with the repository as the working directory, or
122+
- Set `PYTHONPATH` or the equivalent import path explicitly.
123+
- In `openai-agents-python`, prefer `uv run python /tmp/probe.py` from the repository root.
124+
125+
Design the probe to maximize observability:
126+
127+
- Print or log the exact scenario being exercised.
128+
- Capture runtime context such as git SHA, working directory, Python executable and version, relevant package versions, model or deployment name, endpoint or base URL alias, and any retry or tool options that materially affect behavior.
129+
- For live probes, record only the names of environment variables that were approved for use. Never print their values.
130+
- Capture structured outputs when possible.
131+
- Preserve raw error type, message, and status code.
132+
- For repeat-sensitive cases, capture the attempt index, warm-up status, and any stable identifiers that help compare runs.
133+
- For repeated or benchmark-style probes, write both raw results and a compact summary artifact when practical.
134+
- Keep branching minimal so each script answers a narrow question.
135+
136+
Before deleting the temporary script or directory, keep a short run summary of the script path, command used, runtime context, and whether the evidence was kept or deleted.
137+
138+
Open [python_probe.py](./templates/python_probe.py) when you want a lightweight disposable Python probe scaffold.
139+
140+
## Reporting
141+
142+
Report in this order:
143+
144+
1. Findings. Put unexpected or negative findings first. If there was no real news, say that explicitly.
145+
2. Validation approach. Summarize the code used, the runtime surface exercised, the execution modes, and the case matrix coverage.
146+
3. Case results. Include the matrix or a condensed version of it when the case count is large.
147+
4. Artifact status and brief run summary. State whether temporary artifacts were deleted or kept, and provide kept paths or the retained summary.
148+
5. Optional implementation note. Include this only when one clear defect was isolated and a short implementation direction would help.
149+
150+
For comparative probes, the report should also say what was held constant, what variable was under test, and whether the result supports only pattern parity or a broader quality claim.
151+
152+
Open [reporting-format.md](./references/reporting-format.md) for the recommended response template.
153+
154+
## Resources
155+
156+
- Open [validation-matrix.md](./references/validation-matrix.md) to design and prioritize the case matrix.
157+
- Open [error-cases.md](./references/error-cases.md) to expand common failure scenarios.
158+
- Open [openai-runtime-patterns.md](./references/openai-runtime-patterns.md) for recurring OpenAI and Responses API probe patterns.
159+
- Open [reporting-format.md](./references/reporting-format.md) for the final report structure.
160+
- Open [python_probe.py](./templates/python_probe.py) for a minimal disposable Python probe scaffold.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
interface:
2+
display_name: "Runtime Behavior Probe"
3+
short_description: "Plan and run runtime behavior probes"
4+
default_prompt: "Use $runtime-behavior-probe to investigate actual runtime behavior with a validation matrix, explicit state controls, and a findings-first report."
5+
policy:
6+
allow_implicit_invocation: false
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Common Error Cases
2+
3+
Use this reference to expand beyond the happy path. Favor error cases that a real user or operator is likely to hit.
4+
5+
## Configuration Errors
6+
7+
Check whether the runtime behaves differently for:
8+
9+
- Missing required environment variables.
10+
- Present but malformed secrets or identifiers.
11+
- Wrong endpoint or base URL.
12+
- Wrong model or deployment name.
13+
- Incompatible local dependency versions.
14+
15+
Look for:
16+
17+
- Error type and status code.
18+
- Whether the failure is immediate or delayed.
19+
- Whether the message is actionable.
20+
- Whether retrying without fixing configuration changes anything.
21+
22+
## Input Errors
23+
24+
Probe common bad-input patterns such as:
25+
26+
- Missing required fields.
27+
- Wrong data type.
28+
- Unsupported enum or option value.
29+
- Empty but syntactically valid input.
30+
- Oversized input or too many items.
31+
- Mutually incompatible options.
32+
33+
Prefer realistic invalid inputs over artificial nonsense. The point is to learn how the runtime fails in practice.
34+
35+
## Transport and Availability Errors
36+
37+
When networked services are involved, consider:
38+
39+
- Connection failure.
40+
- Read timeout.
41+
- Server timeout or upstream gateway error.
42+
- Rate limit response.
43+
- Partial stream interruption.
44+
- Reusing a connection after a failure.
45+
46+
Capture whether the client library retries automatically, whether it surfaces retry metadata, and whether the final exception preserves the original cause.
47+
48+
## State and Repetition Errors
49+
50+
Many surprising bugs appear only when an operation is repeated or interrupted:
51+
52+
- Re-submit the same request.
53+
- Repeat after a timeout.
54+
- Retry after a partial tool call or partial stream.
55+
- Resume after local cleanup or process restart.
56+
- Repeat with slightly changed inputs while reusing shared state.
57+
58+
Observe whether the operation is idempotent, duplicated, silently ignored, or left in a partial state.
59+
60+
## Concurrency Errors
61+
62+
When shared state, ordering, or isolation may matter, consider:
63+
64+
- Two overlapping requests with the same logical input.
65+
- Parallel runs that reuse the same cache key, session, container, or temporary resource.
66+
- Concurrent retries, cancellation, or cleanup racing with active work.
67+
- Output or event streams from one run leaking into another.
68+
69+
Capture whether the runtime serializes, rejects, duplicates, corrupts, or cross-contaminates the work.
70+
71+
## Investigation Heuristics
72+
73+
Use these heuristics to pick error cases quickly:
74+
75+
- Ask which failure a real engineer would debug first in production.
76+
- Ask which failure is most expensive if it is misunderstood.
77+
- Ask which failure would be invisible from code review alone.
78+
- Ask which failure path is likely to differ across environments.
79+
80+
If the error behavior is already perfectly obvious from a local validator or type system, it is usually low priority for this skill.

0 commit comments

Comments
 (0)