Skip to content

issue_priority_apply discards the GraphQL error, so a failed Priority write cannot be diagnosed from the logs

Id: TD-PPagop-26082322 · Status: resolved · Filed: 2026-08-23 · Resolved: 2026-09-07 · Ref: https://github.com/Pullwright/agent-ops/pull/1217

issue_priority_apply (lib/issue-priority.sh) sends its setIssueFieldValue mutation with >/dev/null 2>&1 and turns any failure into a bare {"applied": false, "reason": "mutation-failed"}. The caller (maybe_run_refiner, agent-cycle.sh) logs a warning naming the repo, the issue and the band, and nothing else — GitHub’s own explanation of why the write failed is discarded at the pipe.

That is what let a one-token schema mismatch run unnoticed across the fleet. The mutation declared $optionId:String! against an argument GitHub types ID, so every write was rejected with Type mismatch on variable $optionId and argument singleSelectOptionId (String! / ID) — a message that names the defect precisely and would have been actionable the first time anyone read it. Instead ockham-container accumulated 14 identical could not set Priority … (mutation-failed) warnings between 2026-08-20 and 2026-08-23, alongside zero issue-prioritised events, and nothing in that record distinguishes “the query is malformed” from “the network was down” or “the token lost the scope”.

Suggested fix: capture the mutation’s stderr and carry it into the result — {"reason": "mutation-failed", "error": "<first line of the GraphQL error>"} — so the caller’s warning can name it. The header comment’s four documented reasons and requirement 39g’s ok/failed vocabulary are unaffected; this adds detail to an existing shape rather than changing it, though docs/IMPLEMENTATION-PIPELINE-SPEC.md’s description of the mutation-failed result (requirement 39g) would need the new key.

Worth weighing at the same time: whether field-unresolvable deserves the same treatment, since it shares the “unknown means cannot write” direction and the same silence, and whether a run of consecutive mutation-failed results should escalate rather than warn once per issue — 14 in three days produced no signal anyone acted on.

Noticed while fixing the type mismatch itself.

Migrated to https://github.com/Poetic-Poems/agent-ops/issues/960.