A review request that did not take is never warned about at either handoff call site
Id: TD-PPagop-26081402 · Status: resolved · Filed: 2026-08-14 · Resolved: 2026-08-14 · Ref: https://github.com/Poetic-Poems/agent-ops/pull/368
Requirement 38a says a failed result from ensure_human_reviewer is a
warning on the pr-ready event, “on the same terms requirement 31b’s own
re-request failure is”. Both call sites in agent-cycle.sh — the Reviewer’s
own handoff (if [[ "$human_reviewer_state" == "failed" ]]) and the Enabler’s
complete_handoff (if [[ "$e_human_reviewer_state" == "failed" ]]) — test
that with an exact string match against the whole return value, and
ensure_human_reviewer (lib/handoff.sh) has two failed shapes:
- a bare
failed, for a read it could not make (the parts, the draft flag, the blocking reviewers, the known reviewers, the author, the pending list); failed<TAB><logins>, for the case the POST was made and did not take — the target is still missing from the pending list afterwards.
The exact match catches the first and silently drops the second. So the one
failure the warning most concerns — the request was actually attempted at the
moment of handoff and GitHub did not record it (a 422 from an invalid login,
a race, a partial failure) — produces no warning at all, and the pr-ready
event records human_review_requested: "failed\t<logins>" rather than the
state alone.
The sibling read of confirm_review_requested a few lines above does not have
this problem: it splits the tab off first
(IFS=$'\t' read -r rereview_state rereview_who <<<"$rereview_result") and
matches on the state, which is also what scripts/sweep-human-visibility.sh
does for both functions. The two ensure_human_reviewer call sites are the
only readers that match the raw return value, which is also why they needed
startswith("skip") in their pr-ready jq when the no-candidate skip
gained its own detail (tech-debt/TD-PPagop-26081001.md, PR #349): the same
unsplit value.
The consequence is bounded but real: the sweep of requirement 38c re-checks
the same pull request next cycle and does warn (could not request review from …), so the violation is not invisible forever — only for as long as it
takes the sweep to come round, and only in the log line that names the moment
of handoff.
Suggested fix: split the tab off at both call sites, exactly as the
confirm_review_requested read beside them already does, and match
"$human_reviewer_state" == "failed" against the state alone — which also
lets the pr-ready jq go back to comparing $hr against plain "skip",
and puts the bare state, not the state plus its logins, into
human_review_requested. The reviewers field of the warning could then name
the logins actually attempted rather than enabler_assignee, which is only
the fallback target. test/handoff.test.sh already covers the
failed<TAB><logins> return; the missing coverage is at the call sites
(test/chain.test.sh, test/human-visibility-wiring.test.sh).
Referenced from: requirement 38a, docs/IMPLEMENTATION-PIPELINE-SPEC.md.