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
9 changes: 9 additions & 0 deletions .github/AGY-REVIEWER.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ runner, so disable fork workflows there or gate them the same way.
| `AGY_TIMEOUT_SECONDS_PER_MIB` | `900` | extra seconds per MiB of diff. A diff handed over as a file costs agy 6-8 minutes almost whatever its size, so this is deliberately steep (240 left a 426 KB diff at 397 s, too little) |
| `AGY_PRINT_TIMEOUT_MAX_SECONDS` | `1800` (workflow: `900`) | ceiling on one attempt after the raise |
| `AGY_RETRIES` | `3` (workflow: `2`) | attempts; a retry is for a transient backend error, so more of them at the same budget only repeat a timeout |
| `AGY_LOCK_WAIT` | `600` (workflow: `1860`) | seconds to wait for the host-wide agy lock before giving up. Every repository's review on the host shares it (agy is one singleton per user), and a review holds it across all its attempts and the pauses between them, so the wait must outlast another review's whole hold: 1860 s covers one review at two 900 s attempts plus the 15 s pause. It counts toward the job's worst case, so raising it means raising `timeout-minutes` (the selftest checks the sum) |
| `AGY_DIFF_MODE` | `auto` | how the diff reaches agy: `inline` (in the `--print` prompt), `file` (written to a file agy reads with its tools), or `auto` (inline if it fits the arg-size budget, else file — so **large PRs are never truncated**) |
| `MAX_DIFF_BYTES` | `5000000` | sanity cap on a pathological diff (5 MB). Not the arg-size limit — a large diff goes to agy as a file, not an argv value |
| `MAX_PROMPT_BYTES` | `120000` | the inline/file threshold in `auto` mode, and a hard backstop on the **inlined** prompt. agy takes an inlined prompt as a `--print` argv value, and a single `execve` argument cannot exceed `MAX_ARG_STRLEN` (128 KiB); over it `execve` fails with E2BIG before agy starts. Clamped below 128 KiB |
Expand All @@ -281,6 +282,14 @@ runner, so disable fork workflows there or gate them the same way.

## Troubleshooting

- **"agy lock timed out after Ns" and a red job with no review:** another
review on the same host held the agy lock longer than `AGY_LOCK_WAIT`. The
lock is shared by every repository's review there, so two PRs opened at once
in different repositories queue behind each other; with a wait shorter than
one review (the old 300 s), the second gives up. Re-run the job once the other
review finishes, and keep `AGY_LOCK_WAIT` above another review's worst-case
hold (`AGY_RETRIES` x the per-attempt cap, plus the pauses). The lock fails
closed: a timeout exits rather than running two agy processes at once.
- **Review comment never appears / job succeeds but empty:** the classic
Antigravity **issue #76** — `agy -p` drops stdout when it isn't attached to a
TTY. This template runs `agy` under a PTY (`unbuffer`, or `scripts/_agy_print.sh`
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/antigravity-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ jobs:
# for a large one handed over as a file. The cap must still exceed the
# script's own worst case -- lock wait + every retry at its maximum timeout +
# backoff -- or the job is killed mid-retry and posts nothing. With the
# settings below that is 300 + 2 x 900 + 15 = 2115 s, under 45 minutes with
# settings below that is 1860 + 2 x 900 + 15 = 3675 s, under 80 minutes with
# room for checkout and the diff fetch; the selftest checks this sum against
# this value.
timeout-minutes: 45
# this value. (Until 2026-11-15: 300 + 2 x 900 + 15 = 2115 s under 45
# minutes; see AGY_LOCK_WAIT for why the wait grew.)
timeout-minutes: 80
steps:
# Check out the DEFAULT BRANCH, never the PR head. This job runs the checked-out
# `scripts/agy-review.sh` on a self-hosted runner with a token in the environment,
Expand Down Expand Up @@ -125,7 +126,17 @@ jobs:
# Two attempts, not three: a retry is for a transient backend error; a third
# attempt at the same budget only repeats a timeout.
AGY_RETRIES: "2"
AGY_LOCK_WAIT: "300" # wait for another review's lock (default 600)
# The lock is shared by EVERY repository's review on this host, not only this
# one's (agy is one singleton per user). 300 s was shorter than one review
# elsewhere: on 2026-11-15 RustyNES_MiSTer's PR #79 and RustyNES's PR #664
# opened together, #664's review of a large diff held the lock, and #79's job
# gave up after 300 s ("agy lock timed out") and went red with no review.
# 1860 s outlasts another review's whole hold: the lock is held across both of its
# attempts at the 15-minute cap AND the 15 s pause between them (2 x 900 + 15 =
# 1815 s), plus a margin for process start-up; this is what moved
# timeout-minutes to 80. The runner is self-hosted, so the longer wait
# bills nothing; the wait is a queue, not a fail-open.
AGY_LOCK_WAIT: "1860" # wait for another review's lock (default 600)
# AGY_DIFF_MODE: auto # auto|inline|file — how the diff reaches agy. `auto`
# # (default) inlines a small diff and hands a large one to
# # agy as a file, so PR size never truncates the review.
Expand Down
Loading