Repository navigation
Description
What happened
Found by principal-review-agent while reviewing PR #229 (itself a
crash-handling fix for issue 227) — see that PR's review comment for the
full trace. Not a finding against PR #229 itself; a pre-existing gap in
all three pipeline workflows that PR happens to touch one instance of.
The gap
dev-agent.yml, qa-agent.yml, and principal-review.yml each have an
early "guard"/"Resolve target" step that runs under set -euo pipefail
with no continue-on-error: true. Their later "Advance PR based on
..." step is gated with a condition like:
if: steps.guard.outputs.skip != 'true' && !cancelled()
!cancelled() is what lets that step still run when the agent step
crashes (the intended, already-fixed case: issue 227 for
principal-review, and the equivalent pre-existing handling in the other
two files) — but it doesn't distinguish "agent step failed" from "guard
step itself failed" (e.g. a transient gh API error, hitting set -e
before the step writes any $GITHUB_OUTPUT at all).
If the guard step fails instead:
steps.guard.outputs.skipwas never written, so it reads as empty —
'' != 'true'is true, same as a realskip=false.- The agent step itself is correctly skipped (its own
ifhas no
override function, so it stays subject to the default "skip once the
job is failing" behavior). - But "Advance PR" does run (its
!cancelled()override bypasses that
same default).steps.agent.outcomereads"skipped", not
"failure"— so the crash-handling branch (the one issue 227 added)
doesn't fire. - It falls through to the normal verdict-parsing path, finds no verdict
file (the agent never ran), and silently defaults to whatever that
workflow's no-verdict fallback is (human-mergefor
principal-review; check the equivalent fallback in the other two)
with no PR comment explaining why — unlike every other path in
these files, which all post an explanation.
Net effect: a transient guard-script hiccup silently mislabels a PR as
"reviewed" (or "needs-info"/whatever each file's fallback is) with zero
audit trail — arguably worse than the original stuck-and-silent bug these
crash-handling branches were built to prevent, just relocated to a
different, less-often-hit step.
Scope
Confirmed to exist in the same shape in all three workflows (grep for
!cancelled() next to a step whose only precondition is a guard-step
output) — not unique to principal-review.yml. A fix should cover all
three together so they don't drift.
Suggested fix (not prescriptive — a human/dev-agent should design this)
Options, roughly in order of how much they change existing behavior:
- Add
continue-on-error: trueto the guard step too, and have it
explicitly writeskip=true(or a distinctguard_failed=true
output) in a trap/||fallback on its own failure — the later step
can then tell "guard genuinely said skip" apart from "guard crashed"
and post its own explanatory comment for the latter. - Give the "Advance PR" step's crash-branch condition an extra check
forsteps.guard.outcome == 'failure', not just
steps.agent.outcome. - At minimum, change each fallback path (the "no verdict found" default)
to always post a comment when it fires, even in the currently-silent
case — cheapest fix, doesn't fully close the gap but removes the
"zero audit trail" part, which is the most concerning piece.
Activity
github-actions commentedon Aug 17, 2026
Implementation blocked — not a scoping problem, a credential permission gap
The fix is scoped and implemented (branch
fix/guard-step-crash-mislabeloffdev, commit locally), but I can't push it or open a PR: neither credential available to this agent has theworkflowspermission GitHub requires to push changes to files under.github/workflows/, which is unavoidable here since this issue lives entirely indev-agent.yml/qa-agent.yml/principal-review.yml.Confirmed both fail with the same rejection:
GITHUB_TOKEN(github-actions[bot]):refusing to allow a GitHub App to create or update workflow .github/workflows/dev-agent.yml without workflows permissionlibravault-pipeline-bot, viaAPP_GH_TOKEN): same rejectionPer
docs/agent-team-pipeline.md's "Cross-workflow triggering" section, the pipeline App is installed with "read/write on code, issues, and pull requests" — no explicitworkflowspermission was granted, so it hits the same GitHub-side restriction asGITHUB_TOKEN(this is a distinct restriction from the "Actions can't create/approve PRs" repo settingAPP_GH_TOKENalready works around — GitHub gates any push that touches.github/workflows/**behind an explicitworkflowsscope/permission, regardless ofcontents: write). A human with a PAT that has theworkflowOAuth scope (or by granting the GitHub App theworkflows: writepermission) can push this in seconds.The fix (tested: YAML-parses cleanly, every
run:block passesbash -n)Root cause confirmed exactly as described in this issue: the "Advance PR"/"Force-classify risk" step in all three workflows runs on
!cancelled()so it can still route an agent-step crash (steps.agent.outcome == 'failure') to a human — but that override also lets it run when the earlier guard step itself crashes before writing itsskipoutput, which reads as empty and is indistinguishable from a realskip=false. That falls through to each workflow's silent no-verdict/no-comment default.Implemented option 2 from the issue body (add an explicit
steps.guard.outcome == 'failure'check, mirroring the existingsteps.agent.outcomecheck) rather than option 1 (restructuring the guard step's own error handling) — it closes the full gap (correct routing and an explanatory comment, not just the comment) with a much smaller diff, and doesn't touch the guard step's owncontinue-on-errorsemantics, which downstream steps like "Mint pipeline App token"/"Run dev agent" currently depend on implicitly (verified: those steps use plainif: steps.guard.outputs.skip != 'true'with no status-check-function override, so they already correctly stay skipped on a guard crash via GitHub's implicitsuccess()gating — confirmed this stays true with the change below, since it never addscontinue-on-errorto the guard step itself).Each of the three "Advance PR"-style steps gets the same shape: a new check at the very top of the
run:block, before any use ofsteps.guard.outputs.*, using only raw event context (github.event.pull_request.number/github.event.issue.number/github.event.inputs.*) since guard's own outputs may never have been written:Full diff (104 lines across the three files):
fix-231.diff
Recommend: a human applies this patch directly (or re-triggers this issue via
workflow_dispatchafter the pipeline App is grantedworkflows: write), then it just needsstatus:ready-for-devre-applied to pick back up — no further design work needed, this is implementation-complete.libravault-xyz commentedon Aug 17, 2026
Dev-agent's implementation was correct but blocked on the
workflowspermission gap (see its comment above). I reviewed the diff against the live files, applied it, and opened #235 to fix this directly, since.github/workflows/**is human-merge-only peragent-policy.ymlregardless.Also dropping
status:ready-for-devhere — it was left applied alongsidestatus:needs-infowhen dev-agent's crash-handling branch removedstatus:in-progressbut not this one, which is its own small instance of the same 'inconsistent label state on an unusual exit path' family of bug. Filing that as a separate follow-up rather than folding it into #235's scope.libravault-xyz commentedon Aug 17, 2026
Triage (2026-08-17): Fix already exists and is sitting ready — PR #235 (
fix/guard-step-crash-mislabel, human-authored) addssteps.guard.outcome == 'failure'checks to the "Advance PR" step indev-agent.yml,qa-agent.yml, andprincipal-review.yml, matching the diff dev-agent had already drafted here. All CI checks on #235 are green (JVM Tests ×2 — itself live evidence of #244 — iOS build, Android build all SUCCESS), and it's currently unlabeled/unmerged.Switching label from
status:needs-infotostatus:blocked— not on missing info, but on a human merging #235 directly (.github/workflows/**is a sensitive path requiring human merge regardless of author). @libravault-xyz: this one just needs a review + merge to close.fix(ci): distinguish guard-step crash from agent-step crash in pipeli…
Merge pull request #235 from LibraVault/fix/guard-step-crash-mislabel