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, 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. If the note also says `Dispatch follows collaboration V2.`, use these rules instead: `spawn_agent` with a unique `task_name` (lowercase letters, digits and `_`), the task as `message`, no `agent_type`, and `fork_turns: "none"`; never `model`, `reasoning_effort` or `fork_context`; a denied spawn: the note's rule; record it in `summary`; `wait_agent` with only `timeout_ms` ≤ 120000, never a target, and a timed-out wait is no result: wait again while any task is running; each result arrives as its own message whose `Sender:` is `/root/<task_name>` (its `Task name:` is your own path), and there is no close; at most four running, starting the next task as each task ends (its result arrives or it is final without one); run `date +%s` after each spawn and at each timed-out wait; a payload that is empty, is `Agent shut down.` or `Agent was not found.`, or starts with `Agent errored:` or `Agent interrupted by Guardian:`, or a task still running 900 s after its spawn (interrupt it with `interrupt_agent` and `target` = the task name `spawn_agent` returned, `/root/<task_name>`; it sends no result) is final for that task: record the gap in `summary` unless `interrupt_agent` reports it `completed`, when its result message is the task's result; do not retry it or read the child's raw rollout. 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. If the note also says `Dispatch follows collaboration V2.`, use these rules instead: `spawn_agent` with a unique `task_name` (lowercase letters, digits and `_`), the task as `message`, no `agent_type`, and `fork_turns: "none"`; never `model`, `reasoning_effort` or `fork_context`; a denied spawn: the note's rule; record it in `summary`; `wait_agent` with only `timeout_ms` ≤ 120000, never a target, and a timed-out wait is no result: wait again while any task is running; each result arrives as its own message whose `Sender:` is `/root/<task_name>` (its `Task name:` is your own path), and there is no close; at most four running, starting the next task as each task ends (its result arrives or it is final without one); run `date +%s` after each spawn and at each timed-out wait; a payload that is empty, is `Agent shut down.` or `Agent was not found.`, or starts with `Agent errored:` or `Agent interrupted by Guardian:`, a payload that is `RESULT WITHHELD BY FULLSEND`, ignoring whitespace around it (the runtime sends it in place of a result it withheld), or a task still running 900 s after its spawn (interrupt it with `interrupt_agent` and `target` = the task name `spawn_agent` returned, `/root/<task_name>`; it sends no result) is final for that task: record the gap in `summary` unless `interrupt_agent` reports it `completed`, when its result message is the task's result; do not retry it or read the child's raw rollout. 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
10 changes: 6 additions & 4 deletions agents/review.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ final-state rule under Constraints:
`wait_agent` never takes one.
- **Final without a result:** a payload that is empty, is
`Agent shut down.` or `Agent was not found.`, or starts with
`Agent errored:` or `Agent interrupted by Guardian:`; and a child
still running 900 s after its spawn: interrupt it (it sends no
result, unless the call reports it `completed`, when its result
message is the result).
`Agent errored:` or `Agent interrupted by Guardian:`; a payload that
is `RESULT WITHHELD BY FULLSEND`, ignoring whitespace around it (the
runtime sends it in place of a result it withheld); and a child still
running 900 s after its spawn: interrupt it (it sends no result,
unless the call reports it `completed`, when its result message is
the result).
Apply that sub-agent's failure fallback (3c-1 item 6, 3c-2, step 5,
6d item 4); never retry the spawn or read the child's raw rollout.
- **Step 3c-1:** `agent_type` `security-triage` when listed, else
Expand Down
9 changes: 8 additions & 1 deletion scripts/codex-v2-dispatch-contract-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
# fullsend's runtime note carries the sentence below once fullsend admits
# collaboration V2 parents (fullsend-ai/fullsend#9085). The review and retro
# agents gate their V2 rules on it, so a wording change on either side must
# change both.
# change both. The same holds for fullsend's withheld notice (its
# codexWithheldNotice), which the V2 rules treat as a final result with no
# content. This test sees only this repository's copies of both strings: a
# change on the fullsend side does not fail it.
#
# The test checks three things:
# - both agents gate on the sentence;
Expand All @@ -27,6 +30,7 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
MARKER='`Dispatch follows collaboration V2.`'
NOTICE='`RESULT WITHHELD BY FULLSEND`'
Comment thread
waynesun09 marked this conversation as resolved.
Resolved
FAILURES=0

pass() { echo "PASS: $1"; }
Expand Down Expand Up @@ -55,6 +59,7 @@ has() {

for f in agents/review.md agents/retro.md; do
has "${f}" "$(join_lines <"${REPO_ROOT}/${f}")" "${MARKER}"
has "${f}" "$(join_lines <"${REPO_ROOT}/${f}")" "${NOTICE}"
done

# --- V2 rule bodies ---------------------------------------------------------
Expand Down Expand Up @@ -112,6 +117,7 @@ for rule in \
'one call per child' \
'a payload that is empty, is `Agent shut down.` or `Agent was not found.`' \
'`Agent errored:` or `Agent interrupted by Guardian:`' \
"a payload that is ${NOTICE}, ignoring whitespace around it (the runtime sends it in place of a result it withheld)" \
'still running 900 s after its spawn: interrupt it' \
'it sends no result, unless the call reports it `completed`, when its result message is the result' \
"Apply that sub-agent's failure fallback" \
Expand Down Expand Up @@ -159,6 +165,7 @@ for rule in \
'run `date +%s` after each spawn and at each timed-out wait' \
'a payload that is empty, is `Agent shut down.` or `Agent was not found.`' \
'`Agent errored:` or `Agent interrupted by Guardian:`' \
"a payload that is ${NOTICE}, ignoring whitespace around it (the runtime sends it in place of a result it withheld)" \
'a task still running 900 s after its spawn (interrupt it with `interrupt_agent`' \
'`target` = the task name `spawn_agent` returned, `/root/<task_name>`; it sends no result' \
'is final for that task' \
Expand Down
Loading