ao review submit still requires the whole review body in one shell argument - models that cannot emit multi-KB tool args can never submit (5701 follow-up)
Follow-up to #5701 (the single-submit contract from #5904 removed the escaping layers, but one failure surface is still open).
Observed failure
A reviewer session today (session 585ec38e, model GLM-5.3-flash, thinking on):
The review was fully composed in thinking — two ~20 KB thinking blocks with the complete findings.
The contract's only sanctioned channel for the body is one command:
printf '%s' '<full review markdown>' | ao review submit --session … --run … --verdict … --body - …The reviewer tried to stage the body first (
cat > /tmp/… <<'EOF') and the generator collapsed: the heredoc body came out as the literal stringPLACEHOLDERinstead of the review markdown.Every fallback is closed by design:
Write/Editare removed from the reviewer sandbox (reviewerDisallowedTools);--bodyrejects anything but-(a file path fails with a usage error, covered by a test);- heredocs are forbidden by the review prompt;
- the PermissionRequest hook auto-allows only the exact
printf '%s' … | ao review submit … --body -shape and denies everything else.
Result: ~330 tool calls in ~50 minutes, ~310 of them no-op Bash
true, zero submits. The review existed only inside the model's head.
Root cause
The tool requires the model to materialize a multi-KB body as one giant single-quoted shell literal — with '\'' escaping for every apostrophe on top. Models that cannot reliably emit multi-KB single tool arguments (generation degrades to placeholder output well before 20 KB) deterministically fail here, and #5904 deliberately closed every alternative channel, so the failure is a dead end rather than a retryable path. The transport is fine (stdin); the composition channel is the problem.
Why the sanctioned command was never attempted
"Pass the body as an argument" is exactly what the contract already mandates — and the reviewer never executed it: zero printf-pipe tool calls in the session. The reason is inherited hygiene rules. The reviewer runs with the operator's global CLAUDE.md, which says multiline text must never be inlined in quotes and heredocs are opaque to a permission parser. Those rules conflict with the AO instruction, and the model reconciled the conflict by routing around the sanctioned shape — "My user global rules discourage opaque multiline inline" (thinking, in-session) — staging a file first and redirecting it, which is where generation collapsed into PLACEHOLDER.
Contract takeaway: a headless/sandboxed session's prompt should explicitly override inherited hygiene rules — state that the inline argument is auto-allowed there and no human will ever be prompted, so the model emits it as instructed instead of improvising a workaround. Without that, the only legal shape loses to the inherited rules before generation even gets a chance to fail.
Mitigation direction
The argument channel works below the model's single-argument emission ceiling — somewhere between 2 KB (hundreds of small commands succeeded in the same session) and 20 KB (the observed PLACEHOLDER collapse, which happened on a heredoc, i.e. even the workaround shape failed; the sanctioned printf shape was never reached). The ceiling is unmeasured.
Direction: keep review bodies under the measured ceiling, and/or publish a shortened form. One constraint to state honestly: the worker receives the same recorded body (review_runs.body) — there is no separate "full text to the worker" channel. Shortening therefore applies to the single body; a "full for the worker + short for GitHub" split would require the model to emit two bodies, i.e. two passes through the same broken channel.
Request
Rework ao review submit so a large multi-line review can be delivered without ever inlining the whole body into one shell argument. Candidate shapes (implementation is upstream's call):
- a structured submission tool exposed to the reviewer session (e.g. an MCP-style tool) whose
bodyfield carries the complete multi-page review in one call — no shell quoting anywhere, the same shape every coding model is trained on for long file content; --body-file <path>for human operators and scripts (not a model path — the reviewer has no write access);- any other shape that keeps the invariants below.
Invariants to keep:
- the complete review is delivered in a single submission — no piecewise assembly: no
--body-begin/--body-append/--body-finishor staged-append protocols; - no single shell argument carries the review body; the body never passes through shell quoting;
- publication stays daemon-owned (
gh apistays out of reviewer policies); - the PermissionRequest hook stays strict — new shapes get their own explicit allow regexes, nothing else opens up;
- resubmission stays idempotent (a rerun records the same review, not a duplicate).
Acceptance
A reviewer model that cannot emit a single shell argument larger than ~2 KB can submit a 20 KB review in one submission, using only sanctioned commands.
Source: Untrivial-ai/agent-orchestrator