Repository navigation
fix(ci): guarantee real CI signal when dev-agent marks a PR ready - #483
libravault-pipeline-bot[bot] wants to merge 2 commits into
Conversation
gh pr ready in the "Force-classify risk and advance to QA" step used the default GITHUB_TOKEN, and GitHub Actions never creates a workflow run for a ready_for_review event attributed to that token (its own anti-recursion protection) — so jvm-tests.yml/ios-app-build.yml silently never ran for PRs that needed zero revisions (confirmed live on PR #432). Switch that call to the App token, and — since the agent's own gh pr ready call (still instructed by the persona) is forced onto GITHUB_TOKEN by claude-code-action regardless of which token this workflow makes available, so it can win the race and make the fixed call above a no-op — also force a real synchronize event under the App token on triage-mode completion specifically, guaranteed to happen exactly once per PR's draft->ready transition. Closes #433
Matches the existing "Check out PR branch" step's caution (issue #386): force the tree to match HEAD after checkout rather than trusting a clean switch, since the empty commit right after runs in the same working directory.
QA verdict: PASSOriginating issue: #433 — Issue #433 is a bug report with no explicit acceptance checklist — QA'd against "the repro no longer reproduces, and a regression test proves it," per the persona. Per-criterion check
What I ran
Note for the human merge (this lands on
|
Principal review — verdict:
|
|
Human-merge sweep: this PR modifies |
|
Human-merge sweep: this PR modifies |
) The "Backstop — take the PR out of draft if it's still one" step called gh pr ready under the default GITHUB_TOKEN, which GitHub Actions refuses to let trigger a real ready_for_review event (its own anti-recursion protection). That silently skipped jvm-tests.yml/ios-app-build.yml's draft-gated jobs and made the backstop step itself fail, which in turn caused "Run QA agent" to never execute and "Advance PR based on QA verdict" to misreport it as "QA agent produced neither a verdict file nor a verdict comment line" — routing correct, CI-green PRs to status:needs-info for reasons unrelated to their content. Mints the pipeline App token earlier (before the backstop step, not just before "Advance PR") and routes gh pr ready through it, matching the fix pattern from issue #433/PR #483. Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
|
Human-merge sweep: this PR touches |
|
Human-merge sweep: reviewed the diff. The token fix (App token for |
What
dev-agent.yml's "Force-classify risk and advance to QA" step calledgh pr ready "$PR_NUMBER"under the defaultGITHUB_TOKEN. GitHubActions never creates a workflow run for a
ready_for_revieweventattributed to
GITHUB_TOKEN(its own anti-recursion protection), sojvm-tests.yml/ios-app-build.ymlsilently never produced a real runfor PRs that went straight from draft to ready with no revisions
needed — confirmed live on PR #432. The checks read
SKIPPEDratherthan surfacing as a failure, so nothing in the pipeline flagged the gap.
Fix
Two changes to the same step in
.github/workflows/dev-agent.yml:gh pr ready "$PR_NUMBER"now runs underAPP_GH_TOKEN(matchingevery other cross-workflow-triggering call in this file), not the
default token.
persona still instructs the agent to mark its own PR ready as one
of its last actions, and
claude-code-actionforces the agent's owngit/gh identity onto
GITHUB_TOKENregardless ofGH_TOKEN/APP_GH_TOKEN(documented in this same workflow's "Run dev agent"step and in
docs/agent-team-pipeline.md'sclaude-code-actiongotchas section) — so the agent's own call typically wins the race
and makes step 1's fixed call a no-op (
gh pr readyon analready-ready PR does nothing and fires no new event). To close that
gap without touching the agent's own behavior, the step now also
pushes an empty
ci: retrigger checks…commit underAPP_GH_TOKEN— a real
synchronizeevent, not subject to the same suppression —scoped to triage-mode completion only (the one point in a PR's life
where it actually leaves draft; revise-mode runs already produce
real synchronize events from their own fix commits).
NEEDS HUMAN DECISION — persona doc left un-updated
.claude/agents/dev-agent.md's "Open the PR early" section still tellsthe agent to call
gh pr readyitself as one of its last actions. Theideal fix would also update that instruction (stop self-readying, let
this workflow's step be the sole place that performs the transition),
which would let step 1 above do the whole job without needing the
belt-and-suspenders empty commit in step 2. I could not make that edit:
the Edit tool declined to write to
.claude/agents/**for me (it's asensitive_pathsentry, and this run's tool permissions enforce thatas a hard block, not just the after-the-fact
risk:highlabeling thepersona describes for other sensitive paths). The workflow-level fix
above works correctly regardless of whether that persona text ever
changes, so nothing is broken by leaving it as-is, but a human should
consider making that edit anyway to remove the now-redundant race and
its always-run empty commit on every triage-mode PR.
Risk
This diff touches
.github/workflows/dev-agent.yml, asensitive_pathsentry inagent-policy.yml—classify_pr_risk.pywill force
risk:highon this PR regardless of size, so it will landon
status:needs-human-mergerather than auto-merging. Flaggingexplicitly per the persona's instructions for touching a sensitive path.
Testing
No local test harness exists for GitHub Actions workflow YAML in this
repo. Verified with:
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/dev-agent.yml'))"(passes) and
shellcheckagainst the modified step's script body with${{ }}expressions placeholder-substituted (no real issues, onlyexpected false positives from the substitution). The actual fix can
only be confirmed by a live run advancing a PR from draft to ready,
same as the original bug was only found that way.
Closes #433