Add AI review workflow - #1998
Conversation
| for harness in harnesses[1:]: | ||
| command = build_harness_command(harness, prompt=prompt) | ||
| run([ | ||
| "tmux", | ||
| "split-window", | ||
| "-d", | ||
| "-c", | ||
| worktree_dir, | ||
| shlex.join(command), | ||
| ]) | ||
|
|
||
| run(["tmux", "select-layout", "tiled"]) |
There was a problem hiding this comment.
🟡 Requesting the maximum number of review agents can abort with a pane error
New review panes are all carved out of the same starting pane (tmux split-window -d at scripts/ai:314-321) before the tiled layout is applied, so each split halves that one pane and a large request can fail with a "no space for new pane" error that crashes the command.
Impact: Running the heavy review with the highest allowed agent count can abort partway on normally-sized terminals, leaving a half-built set of panes instead of the requested reviewers.
Why repeatedly splitting one pane runs out of space
Because each tmux split-window uses -d, the active pane never changes, so every split targets the original pane 0. With reviewer_count=3 there are 6 agents and 5 sequential splits of pane 0, halving its height each time. On a typical ~50-line terminal this reaches a sub-1-line pane and tmux returns a non-zero exit, which run(...) (scripts/ai:314, check=True via scripts/ai:18) turns into an uncaught CalledProcessError. select-layout tiled is only invoked once after the loop (scripts/ai:323), so it cannot relieve the pressure during splitting. Re-tiling inside the loop (or splitting the smallest/last pane) would avoid the failure.
Prompt for agents
In open_heavy_review (scripts/ai), the loop creates every extra pane with `tmux split-window -d`, which always targets the still-active original pane. Because the active pane never changes, all splits repeatedly halve pane 0, and for the maximum allowed reviewer_count (3 -> 6 panes -> 5 splits) the pane becomes too small and tmux exits non-zero, raising an uncaught CalledProcessError. Consider re-running `tmux select-layout tiled` inside the loop after each split so panes are redistributed evenly before the next split, ensuring enough room for all requested panes regardless of count.
Was this helpful? React with 👍 or 👎 to provide feedback.

Summary
./ai review <pr-number> [additional-prompt]on top of the existing PR worktree checkout flow/review PR#<number>while preserving an optional prompt verbatim--heavy [N]for tiled tmux review sessions with N Codex and N Claude agents; bare--heavydefaults to two of each and N is limited to 1-3Validation
python3 -m unittest discover -s tests -p "test_*.py"task fmttask linttask test