fix(#1541): re-dispatch review after stale-head discard - #1834
Conversation
Site previewPreview: https://7ef046c8-site.fullsend-ai.workers.dev Commit: |
ReviewFindingsMedium
Low
Previous runReviewFindingsMedium
Low
|
ralphbean
left a comment
There was a problem hiding this comment.
LGTM. One minor note inline.
| "[.[] | select(.body | contains(\"${REDISPATCH_MARKER}\")) | ||
| | select(.created_at > (now - 300 | strftime(\"%Y-%m-%dT%H:%M:%SZ\")))] | ||
| | length" 2>/dev/null || echo "0") | ||
|
|
There was a problem hiding this comment.
[moderate] The marker value is hardcoded so this is safe today, but jq's --arg would make it defensive by default:
gh api ... --arg marker "${REDISPATCH_MARKER}" --jq \
'[.[] | select(.body | contains($marker))
| select(.created_at > (now - 300 | strftime("%Y-%m-%dT%H:%M:%SZ")))] | length'Non-blocking — just a pattern worth adopting if we touch this again.
When the review agent detects a stale HEAD (e.g. after a force-push during review), it posts a discard notice but no follow-up review is triggered. This leaves the PR with zero agent review. Three changes fix this: 1. Add a staleHeadError type in postreview.go that carries exit code 10 (StaleHeadExitCode), distinguishing stale-head from other errors. 2. Update cmd/fullsend/main.go to detect errors implementing an ExitCode() method and exit with that code instead of the default 1. 3. Update post-review.sh to catch exit code 10 and re-dispatch a fresh review by posting a /fs-review comment on the PR. A loop guard checks for recent re-dispatch comments (within 5 minutes) to prevent cascading dispatches from rapid force-pushes. Note: pre-commit could not run due to infrastructure error (Go toolchain download permission denied in sandbox). The post-script runs an authoritative pre-commit check on the runner. Closes #1541 Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: fullsend-code <fullsend-code@users.noreply.github.com>
2291028 to
aaf3d9d
Compare
|
🤖 Finished Review · ✅ Success · Started 6:40 PM UTC · Completed 6:52 PM UTC |
|
🤖 Finished Retro · ✅ Success · Started 7:41 PM UTC · Completed 7:48 PM UTC |
Retro: PR #1834 — Re-dispatch review after stale-head discardOverall assessment: This was a clean, efficient workflow. The code agent produced a working solution in a single commit (~14 min), the review agent caught two real bugs, and the human reviewer approved the same day. No fix agent cycles were needed. Total agent compute was ~38 minutes; the 6-day wall-clock time to merge was entirely human latency. What went well:
Proposals filed: 1 proposal targeting a real bug the code agent introduced that the review agent caught. The pagination pitfall ( Skipped proposals:
Proposals filed
|
When the review agent detects a stale HEAD (e.g. after a force-push during review), it posts a discard notice but no follow-up review is triggered. This leaves the PR with zero agent review.
Three changes fix this:
Add a staleHeadError type in postreview.go that carries exit code
10 (StaleHeadExitCode), distinguishing stale-head from other
errors.
Update cmd/fullsend/main.go to detect errors implementing an
ExitCode() method and exit with that code instead of the
default 1.
Update post-review.sh to catch exit code 10 and re-dispatch a
fresh review by posting a /fs-review comment on the PR. A loop
guard checks for recent re-dispatch comments (within 5 minutes)
to prevent cascading dispatches from rapid force-pushes.
Note: pre-commit could not run due to infrastructure error (Go toolchain download permission denied in sandbox). The post-script runs an authoritative pre-commit check on the runner.
Closes #1541
Post-script verification
agent/1541-stale-head-redispatch)972ce7f6654f0b7edaf699298901b10db69e4e4c..HEAD)