feat(examples,sdk): PR-close-loop flow — subscribe to CI+Bugbot, fix until green (#354) - #355
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…until green (#354) Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82
…354) Bugbot MED on #355: `sleep ${input.pollIntervalSeconds ?? 15}` sits inside an f.run step. A caller who passes `pollIntervalSeconds: 60` gets a sleep longer than the kernel deterministic-step lease (~30 s), which fails the step and takes the whole close-pr flow down instead of polling. parseInput now clamps to MAX_POLL_INTERVAL_SECONDS = 25 silently. Existing positive-integer floor is preserved. Added a regression test in tests/close-pr-flow.test.ts covering cap, pass-through under cap, and that zero / negative still throw. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82
9f0e0d5 to
d93d89d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d93d89d. Configure here.
| + `--jq ${quote('[.[][] | select(.user.login == "cursor[bot]" or .user.login == "bugbot[bot]" or .user.login == "cursor" or .user.login == "bugbot") | {id,body,path,html_url,user:{login:.user.login}}]')}`); | ||
| const threads = await run(`gh api graphql --paginate --slurp -f query=${quote(threadsQuery)} ` | ||
| + `-f owner=${quote(owner!)} -f name=${quote(name!)} -F number=${pr} ` | ||
| + `--jq ${quote('[.[].data.repository.pullRequest.reviewThreads.nodes[] | {isResolved,isOutdated,commentId:.comments.nodes[0].databaseId}]')}`); |
There was a problem hiding this comment.
Incompatible gh slurp and jq flags
High Severity
Comment and thread snapshots pass --paginate --slurp --jq to gh api together. GitHub CLI rejects that combination, so those f.run steps fail immediately and the close loop never reads Bugbot findings or thread resolution.
Reviewed by Cursor Bugbot for commit d93d89d. Configure here.


Closes #354. Delivered via implement-slice.flow.ts (dogfood, claude).
Note
Medium Risk
The flow performs force-push, squash merge, and agent-driven edits on a declared worktree; CLI completion semantics change for authored
needs_human, though scoped to the new executor path.Overview
Adds a dogfood
close-prflow that drives a slice PR to merge: validate worktree/branch, open or reuse a PR, pollghfor checks plus Bugbot comments and review-thread resolution, run up to three agent repair cycles (commit + force-with-lease push), then squash-merge with--match-head-commitor finish withf.done('needs_human')and journaled blockers.Extends the surface authoring contract with
FlowCompletionReason(needs_humanalongside kernel run reasons). The authored executor andflows rundirect path treat that as an authored handoff: terminal journal step with JSON outcome, exit 3 andparkedstatus (not a new kernel completion reason).Ships
close-pr-statehelpers (fail-closed parsing, poll-interval cap for step leases), README and local verification notes, plus broad Vitest coverage (mocked GitHub/agent loop and one real git remote exercise).Reviewed by Cursor Bugbot for commit d93d89d. Bugbot is set up for automated code reviews on this repo. Configure here.