|
8 | 8 | # AGENTCORE_ROOT=/path/to/agentcore |
9 | 9 | # TARGET=/path/to/your/repo |
10 | 10 | # AGENTCORE_ROOT="$AGENTCORE_ROOT" bun run --cwd "$AGENTCORE_ROOT" ./src/workflow/run.ts \ |
11 | | -# "$AGENTCORE_ROOT/examples/agent-pr-loop.yaml" --workspace "$TARGET" --verbose |
| 11 | +# "$AGENTCORE_ROOT/examples/agent-pr-loop.yaml" --workspace "$TARGET" --supervised --verbose |
12 | 12 |
|
13 | 13 | name: agent-pr-loop |
14 | 14 | version: "1" |
@@ -140,21 +140,67 @@ steps: |
140 | 140 |
|
141 | 141 | review_fix_loop: |
142 | 142 | description: "Review by OpenCode; if fixes needed, apply via Codex CLI; repeat until PASS" |
143 | | - worker: CUSTOM |
| 143 | + worker: OPENCODE |
| 144 | + model: "openai/gpt-5.2" |
144 | 145 | depends_on: [implement] |
145 | 146 | instructions: | |
146 | | - bun run "${AGENTCORE_ROOT:-.}/scripts/agent-pr-loop/review-fix-once.ts" |
147 | | - capabilities: [READ, EDIT, RUN_TESTS, RUN_COMMANDS] |
148 | | - timeout: "30m" |
| 147 | + You are OpenCode. |
| 148 | +
|
| 149 | + Task: |
| 150 | + - Review the work against the request. |
| 151 | + - Write/update: |
| 152 | + - .agentcore-loop/review.md |
| 153 | + - .agentcore-loop/review.verdict (PASS or FAIL only) |
| 154 | + - If verdict is FAIL, also write/update: |
| 155 | + - .agentcore-loop/fix.md (non-empty; concrete, actionable steps; include file paths) |
| 156 | +
|
| 157 | + Before reviewing, generate these review inputs (workspace is a git repo): |
| 158 | + - mkdir -p .agentcore-loop |
| 159 | + - BASE_BRANCH=$(cat .agentcore-loop/base-branch.txt 2>/dev/null || echo main) |
| 160 | + - git fetch origin "$BASE_BRANCH" >/dev/null 2>&1 || true |
| 161 | + - if git show-ref --verify --quiet "refs/remotes/origin/$BASE_BRANCH"; then BASE_REF="origin/$BASE_BRANCH"; elif git show-ref --verify --quiet "refs/heads/$BASE_BRANCH"; then BASE_REF="$BASE_BRANCH"; else BASE_REF="HEAD"; fi |
| 162 | + - git diff --no-color "$BASE_REF" > .agentcore-loop/review.diff || true |
| 163 | + - git status --porcelain=v1 > .agentcore-loop/review.status || true |
| 164 | + - git ls-files --others --exclude-standard > .agentcore-loop/review.untracked || true |
| 165 | +
|
| 166 | + You must read at least: |
| 167 | + - .agentcore-loop/request.md |
| 168 | + - .agentcore-loop/design.md (if present) |
| 169 | + - .agentcore-loop/todo.md (if present) |
| 170 | + - .agentcore-loop/review.diff |
| 171 | + - .agentcore-loop/review.status |
| 172 | + - .agentcore-loop/review.untracked |
| 173 | +
|
| 174 | + Format for .agentcore-loop/review.md: |
| 175 | + - Sections: Summary, Strengths, Issues, Verification |
| 176 | + capabilities: [READ, EDIT, RUN_COMMANDS] |
| 177 | + timeout: "15m" |
149 | 178 | on_failure: retry |
150 | 179 | max_retries: 2 |
151 | 180 |
|
152 | 181 | completion_check: |
153 | | - worker: CUSTOM |
| 182 | + worker: CODEX_CLI |
| 183 | + model: "gpt-5.3-codex" |
154 | 184 | instructions: | |
155 | | - bash "${AGENTCORE_ROOT:-.}/scripts/agent-pr-loop/verdict-check.sh" |
156 | | - capabilities: [READ, RUN_COMMANDS] |
157 | | - timeout: "30s" |
| 185 | + You are Codex CLI. |
| 186 | +
|
| 187 | + Read: |
| 188 | + - .agentcore-loop/review.verdict |
| 189 | + - .agentcore-loop/fix.md (if present) |
| 190 | + - .agentcore-loop/todo.md (if present) |
| 191 | +
|
| 192 | + Task: |
| 193 | + - If .agentcore-loop/review.verdict is PASS: |
| 194 | + - Print EXACTLY "COMPLETE" on its own line as the final line and exit successfully. |
| 195 | + - If verdict is FAIL: |
| 196 | + - Apply the fixes described in .agentcore-loop/fix.md (minimal changes). |
| 197 | + - Run tests (bun test if present; otherwise choose the most appropriate command). |
| 198 | + - Print EXACTLY "INCOMPLETE" on its own line as the final line and exit successfully. |
| 199 | +
|
| 200 | + Output rules: |
| 201 | + - Always ensure the last non-empty line is either COMPLETE or INCOMPLETE. |
| 202 | + capabilities: [READ, EDIT, RUN_TESTS, RUN_COMMANDS] |
| 203 | + timeout: "20m" |
158 | 204 |
|
159 | 205 | max_iterations: 5 |
160 | 206 | on_iterations_exhausted: abort |
|
0 commit comments