fix(agent-actions): add ctx.headSha fallback + rationale to update_branch - #2430
Conversation
…anch performAction's update_branch case passed action.expectedHeadSha directly into updatePullRequestBranch with no ?? ctx.headSha fallback, unlike the approve/merge cases immediately above it. Add the same fallback for parity, and document why update_branch does NOT need the accept-flow-level "unpinned -> deny" gate #2377/#2422 added for approve/merge: it only merges the base into the head, never contributor-controlled content, so it cannot itself ratify unreviewed code, and it's already covered by the generic freshness guard + the approval-queue's actionClass-agnostic supersede check. Closes #2424
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-01 22:49:52 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2430 +/- ##
=======================================
Coverage 95.85% 95.85%
=======================================
Files 224 224
Lines 25104 25104
Branches 9129 9130 +1
=======================================
Hits 24064 24064
Misses 427 427
Partials 613 613
🚀 New features to boost your workflow:
|
Summary
performAction'supdate_branchcase passedaction.expectedHeadShadirectly intoupdatePullRequestBranchwith no?? ctx.headShafallback, unlike theapprove/mergecases immediately above it — a real, if narrow, asymmetry.update_branchdoes NOT need the accept-flow-level "unpinned → deny" gate that#2377/#2422added for approve/merge: it only merges the current base into the head (never contributor-controlled content), so it cannot itself ratify unreviewed code — the worst case is a premature rebase that fires a fresh synchronize and gets re-reviewed on the next pass. It's also already covered by the generic freshness guard and the approval-queue'sactionClass-agnostic supersede check, both of which run before any action class reaches this switch.Closes #2424
Test plan
npm run typecheckcleannpm run test:coverage: 312 files / 5822 tests passing, no threshold failuresnpm audit --audit-level=moderate: 0 vulnerabilities?? ctx.headShafallback actually fires for an unpinned stagedupdate_branch(previously untested — the existing fixture was always pre-pinned)