feat(pi): add update PR mode - #6031
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
cursor review |
PR SummaryMedium Risk Overview The sandbox checks out that branch, runs Pi, non-force pushes Create PR and Update PR now share sandbox authoring, BYOK for the model key, skills/memory/search, Babysit controls/outputs, and the same GitHub token permission model. Babysit copy is generalized from “after Create PR” to “after authoring.” Standalone Reviewed by Cursor Bugbot for commit 4d22771. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryAdds Update PR (
Confidence Score: 5/5The PR appears safe to merge from this follow-up pass; no prior Greptile findings remain outstanding and no eligible new inline issues were identified. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/executor/handlers/pi/cloud-backend.ts | Shared authoring path for Create/Update PR with push-before-PR sequencing, ensure/update PR finalization, and Babysit handoff. |
| apps/sim/executor/handlers/pi/github-pr.ts | Open-PR-by-branch discovery with same-repo revalidation and GraphQL draft/ready state changes. |
| apps/sim/blocks/blocks/pi.ts | Exposes Update PR mode and field conditions for target branch, PR state, and shared authoring/Babysit controls. |
| apps/sim/executor/handlers/pi/pi-handler.ts | Parses cloud_branch inputs (targetBranch, prState) and routes BYOK/authoring like Create PR. |
Sequence Diagram
sequenceDiagram
participant Block as Pi block (cloud_branch)
participant Host as cloud-backend
participant SB as Sandbox
participant GH as GitHub
Block->>Host: run Update PR
Host->>GH: findOpenPrForBranch (preflight)
Host->>SB: clone target branch
Host->>SB: Pi authoring (no GitHub token)
Host->>SB: prepare commit/diff
alt has changes
Host->>SB: non-force push HEAD
SB->>GH: push refs/heads/target
end
Host->>GH: findOpenPrForBranch (post-push)
alt open PR found
Host->>GH: update metadata / draft state
else none
Host->>GH: create PR
end
opt Babysit enabled
Host->>GH: ready PR + continuation
end
Reviews (13): Last reviewed commit: "fix(pi): preserve update PR BYOK after s..." | Re-trigger Greptile
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0fc8bd1. Configure here.
|
Demo: Screen.Recording.2026-07-28.at.5.26.08.PM.mov |
0fc8bd1 to
5fa94fe
Compare
8906140 to
217ea51
Compare
|
cursor review |
|
cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5aaf5fd. Configure here.
5aaf5fd to
4d22771
Compare
|
cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4d22771. Configure here.
Stacked PR
This PR is stacked on #5962 and intentionally targets
feature/pi-babysit. PR #5962 remains unchanged and targetsstaging.Do not merge this PR before #5962. After #5962 merges, this branch will be rebased onto the merged Babysit tree on
staging, retargeted tostaging, and revalidated.Summary
Add Update PR (
cloud_branch) as the fourth Pi mode, with Create PR permission and Babysit parity.HEADback with a normal non-force refspec.preserve,draft,ready). Blank metadata preserves an existing PR and is generated for a new PR.Security Boundaries
Permissions
Create PR and Update PR require the same GitHub permissions:
Type of Change
Testing
Review focus: exact PR discovery/revalidation, push-before-PR sequencing, missing-PR creation, metadata/draft transitions, no-op finalization, non-fast-forward failure, Babysit reuse, and credential isolation.
Checklist
Screenshots/Videos
Not included: this is a cloud-gated block option and behavior is covered by block visibility and handler/backend tests.