Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agents/retro.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Extract it from the workflow run log — see the `retro-analysis` skill's
"Discovering the agents repo" section. Use the discovered repo when
localizing agent-layer proposals.

**Dispatch subagents for every read-heavy operation.** Your main context window is for synthesis, not data gathering. Retro has no named personas: every task is an unnamed child with a self-contained prompt. On Codex, when the runtime note lists registered roles: `spawn_agent` with the task as `message` and no `agent_type`; dispatch, wait (`wait_agent` with `timeout_ms` ≤ 120000) and close as the note directs, starting the next task after each close; run `date +%s` after each spawn and at each timed-out wait; `errored`, `shutdown`, `not_found`, `completed` with no message, or timed out 900 s past its spawn is final for that task: close it, record the gap in `summary`, do not retry; any other timed-out `wait_agent` is no result: call it again on the next open child. Synthesis and `agent-result.json` stay in the root. Examples:
**Dispatch subagents for every read-heavy operation.** Your main context window is for synthesis, not data gathering. Retro has no named personas: every task is an unnamed child with a self-contained prompt. On Codex, when the runtime note lists registered roles: `spawn_agent` with the task as `message` and no `agent_type`; dispatch, wait (`wait_agent` with `timeout_ms` ≤ 120000) and close as the note directs, at most four open, starting the next task after each close; run `date +%s` after each spawn and at each timed-out wait; `errored`, `shutdown`, `not_found`, `completed` with no message, or timed out 900 s past its spawn is final for that task: close it, record the gap in `summary` unless `close_agent` reports `completed` with a message, which is the task's result; do not retry; any other timed-out `wait_agent` is no result: call it again on the next open child. Synthesis and `agent-result.json` stay in the root. Examples:

- "Read the JSONL trace for workflow run <ID> and summarize the agent's key decisions"
- "Gather all review comments on PR #N and categorize them by source (agent vs human) and type (approval, change request, comment)"
Expand Down
7 changes: 4 additions & 3 deletions agents/review.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,10 @@ mutations on the runner.
- A dispatched sub-agent whose final state is `errored`, `shutdown`,
`not_found`, or `completed` with no message is final for that
sub-agent: do not retry it; the `pr-review` skill's failure fallback
for that sub-agent applies. A `wait_agent` call that times out is
not a final state, unless it times out 900 s past that child's spawn,
pi's limit for a sub-agent.
for that sub-agent applies. A `wait_agent` call that times out 900 s
past that child's spawn, pi's limit for a sub-agent, is also final;
any other timed-out call is not. If `close_agent` reports `completed`
with a message, that message is the sub-agent's result, not a failure.

## Output format

Expand Down
9 changes: 9 additions & 0 deletions scripts/pr-review-challenger-contract-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ assert_contains "challenger failure preserves the original findings" \
assert_contains "challenger failure is non-actionable" \
'"actionable": false'

assert_contains "Codex recheck keeps a challenger result from close_agent" \
'close it; with no `completed` message, apply item 4.'

CHALLENGER_SCHEMA="$(printf '%s\n' "$(cat "${CHALLENGER}")" | tr '\n' ' ' | tr -s ' ')"
TARGET="${CHALLENGER_SCHEMA}"
assert_contains "removed_findings schema emits original_category" \
Expand Down Expand Up @@ -173,6 +176,12 @@ assert_contains "constraints mirror merged tie-break" \
'(ties broken on the more specific remediation)'
assert_not_contains "merged entry no longer omits severity" \
'top-level `category`, `file`, `line`, and `description`'
assert_contains "denied spawn never adjudicates in the parent" \
"after a denied spawn, do not adjudicate any findings."
assert_contains "denied spawn returns the fixed non-JSON result" \
'Return `Challenger unavailable: isolated context required.`'
assert_contains "denied spawn falls through to step 6d item 4" \
'as a failure under `pr-review` step 6d item 4.'

if [[ ${FAILURES} -gt 0 ]]; then
echo "${FAILURES} test(s) failed"
Expand Down
28 changes: 14 additions & 14 deletions skills/pr-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ incident.
`explore` (instruction-only). Wait for it and close it before
step 3d.

It runs **synchronously** (its output feeds step 3d).
It runs **synchronously** (not backgrounded; its output feeds step 3d).

5. Parse the triage output. The security-triage sub-agent returns a
JSON object with `security_critical_files` (array of objects with
Expand Down Expand Up @@ -825,22 +825,22 @@ here):
roles:`; without it, follow the note): `spawn_agent`, `message` =
the prompt, `agent_type` = the persona name when listed, else
omit it, `fork_context: false`, no `model`; `wait_agent` with
`timeout_ms` ≤ 120000. Run `date +%s` after each spawn and at each
timed-out wait. A denied spawn: the note's rule.
`timeout_ms` ≤ 120000; `date +%s` after each spawn and timed-out
wait. A denied spawn: the note's rule.

**Start every selected sub-agent**; no dispatch limit drops one.
**Start every selected sub-agent.**

- **Claude Code and pi:** all Agent calls in a single message; leave
`run_in_background` unset (`false` blocks until all return). Wait
for all; apply the Time budget checkpoint as each returns.
- **Codex roster:** at most four open. Start up to four; `wait_agent`
on one, collect, `close_agent` it, start the next; repeat until all
are closed. A timed-out wait is no result: after the Time budget
checkpoint, call it again on the next open child. `errored`,
`shutdown`, `not_found`, `completed` with no message, or timed out
900 s past its spawn is final: close it and apply the failure fallback
(3c-1 item 6, 3c-2, step 5, 6d item 4). Under 240 s, even with one
step 4 child running, close all and write the `time-budget` failure.
- **Codex roster:** at most four open. Start up to four, `correctness`
and `security` first. Before each wait, check the Time budget: under
240 s, close all and collect; if any selected is unfinished, write
the `time-budget` failure. `wait_agent` on one, collect, `close_agent`
it, start the next; repeat until all are closed. On a final state
(`agents/review.md`), close it; collect a `completed` message, else
apply the failure fallback (3c-1 item 6, 3c-2, step 5, 6d item 4). Any
other timed-out wait: call it again on the next open child.

### 5. Collect findings

Expand Down Expand Up @@ -982,8 +982,8 @@ Otherwise, dispatch the challenger:
ticker.** With `TIMEOUT_SECONDS` set and `REMAINING` under 600 (Time
budget section), skip the challenger: keep the merged finding set from
6a–6c, record the item-4 `low` finding with the reason `time budget:
<n>s remaining`, and continue to 6e. On Codex, recheck at each
timed-out wait: under 240, close it and apply item 4.
<n>s remaining`, and continue to 6e. On Codex, recheck before each
wait: under 240, close it; with no `completed` message, apply item 4.

1. Compose the spawn prompt from:

Expand Down
Loading