Repository navigation
fix(ci): raise principal-review max-turns and salvage verdict on crash - #299
libravault-pipeline-bot[bot] wants to merge 1 commit into
Conversation
The agent's last action before a normal finish is writing principal-verdict.txt, so hitting --max-turns one turn later than usual is common, not rare. Raise the cap from 40 to 70 for headroom above the observed 41-turn near-misses, and make the crash-handling branch in "Advance PR based on review verdict" check principal-verdict.txt for a valid verdict before discarding it — only fall back to status:needs-info when there's truly no usable verdict on disk. Closes #297
📱 iOS Build Status: PASSED✅ iOS Simulator Build & Unit Tests - success iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those. |
QA verification — PR #299 vs issue #297Issue type: bug report, no explicit checklist — criteria used: (a) the reported crash-discards-valid-verdict pattern no longer reproduces, (b) a regression check proves it. What I didThis is a workflow-YAML-only diff (single file,
|
|
This PR's branch is stale relative to |
|
Automated pipeline health check: Update on the duplicate-PR situation QA flagged above (05:03:03Z comment). PR #298 (the other fix for #297) has since merged — 2026-08-19T05:48:39Z, raising That means this PR is now fully redundant, not just a same-day duplicate risk — its changes are already live on Recommend a human close this PR without merging rather than rebasing it — a rebase would just make it a no-op diff against Generated by Claude Code |
|
Superseded by #298, which already merged the same fix (raised |
What
principal-review.yml's "Run principal review agent" step is capped at--max-turns 40, which routinely brushes against the agent's actual turncount (observed 41-turn near-misses on 4 same-day PRs: #257, #264, #281,
and flagged once before on #279). When it hits,
steps.agent.outcomereports
failure, and the "Advance PR based on review verdict" stepdiscarded
principal-verdict.txtunconditionally on that outcome — eventhough the agent's last action before ending is writing that exact file,
so a valid verdict is very often already on disk when the crash happens.
Fix
--max-turnsfrom40to70— real headroom above theobserved 41-turn near-misses, without going as high as
dev-agent.yml's90(that workflow does substantially more: editing, running builds).principal-verdict.txteven whensteps.agent.outcome == 'failure'. Ifit holds a valid verdict (
auto-mergeorhuman-merge), that verdict isused and the PR gets a comment noting the run crashed right after
writing it (visibility, per the issue's ask) — labels/auto-merge/
human-merge routing all proceed exactly as a normal run. Only truly
unusable state (no file, or a crash before any file exists) still routes
to
status:needs-info, unchanged from before.Closes #297
Risk
This touches
.github/workflows/**, one ofagent-policy.yml'ssensitive_paths, soclassify_pr_risk.pywill forcerisk:highon thisdiff regardless of size — flagging that explicitly here so the principal
review agent doesn't have to rediscover it. The change is scoped to a
single workflow file and does not touch
agent-policy.ymlor any othersensitive path.
Testing
No local emulator/CI harness exists for a workflow file's embedded
run:bash, so I extracted the exact "Advance PR" script via a small Python/YAML
snippet, substituted realistic values for every
${{ }}expression, andran it against a mocked
ghCLI to exercise all 5 relevant paths:principal-verdict.txtat all → routes tostatus:needs-info(unchanged behavior, verified still intact).principal-verdict.txtcontainsauto-merge→verdict is used,
status:approved-auto-mergeapplied, crash-visibilitycomment posted.
principal-verdict.txtcontainshuman-merge→ same,routes to
status:needs-human-merge.auto-merge→ unchanged behavior.human-merge(unchanged behavior).Also ran
bash -nandshellcheckover the extracted script (the onlyshellcheck findings are expected false positives on GitHub Actions'
${{ }}expression syntax, not real issues) and validated the full YAMLfile parses with
python3 -c "import yaml; yaml.safe_load(...)".