Skip to content

Post-review should deliver agent findings as informational comments on merged PRs instead of silently discarding them #74

Open

Description

@fullsend-ai-retro

What happened

On PR #73, the review workflow started at 18:33:32 UTC. The pre-review.sh script ran at ~18:34 and confirmed the PR was OPEN. The review agent ran from ~18:34 to ~18:39 (opus model, 6 sub-agents dispatched). The PR was self-merged by the author at 18:36:39 — 3 minutes 22 seconds after creation. At 18:39:45, post-review.sh detected PR_STATE=MERGED and executed the early-exit path (lines 37-53), posting a generic 'Review skipped — this PR is already merged' comment and discarding the agent's result. The same discard pattern occurred on PR #59, where the review completed at 14:51 and posted 'Review skipped' after the PR was merged at 14:47. Workflow run.

What could go better

The review agent consumed significant tokens (opus model, 6 sub-agents, ~5 minutes of inference) on PR #73, but its entire analysis was silently discarded because the PR was merged 2.5 minutes before the post-script ran. The upstream issue fullsend-ai/fullsend#3690 tracks the pre-script abort case where the PR is merged before the agent starts, but PR #73 demonstrates the mid-execution variant where the PR was OPEN at pre-script time and merged during agent execution — a case that pre-script abort cannot address.

Confidence: Medium. High confidence that the token waste pattern recurs (2+ instances in this repo). Medium confidence in the proposed fix — for trivial PRs like #73, the review would likely be an approve with no substantive findings, adding noise without value. The value scales with diff complexity: informational post-merge reviews are most useful when substantive findings were produced.

Proposed change

In scripts/post-review.sh lines 37-53, change the merged-PR handling. When PR_STATE != OPEN, instead of immediately posting the generic skip message and exiting, check whether the agent produced an agent-result.json with a non-empty body field. If so, post the review body as a PR comment (not a GitHub review) prefixed with a banner: 'This review completed after the PR was merged. Findings are provided for informational purposes only.' If the result has no body or the action is approve with no findings, fall back to the existing brief skip message. Skip all outcome label application and gh pr review calls. The change is ~20 lines: after the PR_STATE check, use the same find logic from line 56 to locate the result file, extract the body with jq, and conditionally post it.

Validation criteria

  1. When a PR is merged during review agent execution and the agent produced findings, the findings appear as a PR comment with a clear 'post-merge informational' banner — not as a blocking GitHub review.
  2. No outcome labels (ready-for-merge, requires-manual-review, rejected) are applied to merged PRs.
  3. When the agent result has no body, no findings, or action is approve with no findings, the comment is the existing brief skip message (no regression on clean merges).
  4. The existing pre-script skip behavior (PR merged before agent starts, no result file produced) is unchanged.
  5. Unit test coverage in scripts/post-review-test.sh covers the merged-PR-with-findings path.

Generated by retro agent from #73

Activity

  1. added
    ready-for-triage
    on Jul 8, 2026
  2. fullsend-ai-triage commented on Jul 8, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 6:49 PM UTC · Completed 6:52 PM UTC
    Commit: e8381e3 · View workflow run →

  3. fullsend-ai-triage commented on Jul 8, 2026

    @fullsend-ai-triage

    Re-checked per the maintainer's stale-issue request. The behavior this issue describes is still present: scripts/post-review.src.sh still unconditionally posts the generic 'Review skipped' message and exits on any non-OPEN PR state without checking whether the agent produced findings, exactly as originally reported.

    A related-but-distinct upstream item, fullsend-ai/fullsend#3690 (pre-script abort for PRs merged before the agent starts), shipped its underlying harness mechanism after this issue was filed, but that mechanism cannot help the case this issue targets — a PR merging during agent execution, after the pre-script already confirmed it was open. The two issues remain complementary, not sequential; #3690 is not a prerequisite for this one.

    No open PR in this repository addresses this issue. One open PR (#1163) adds a mid-run re-check mechanism to several agents, but it reacts to new comments or a moved commit head, not to a merge event, and does not touch post-review.sh's merged-PR handling — it does not resolve this issue.

    The original root cause and proposed ~20-line fix in post-review.sh still apply and are reproduced above along with an expanded test-case list. Per the maintainer's instruction, this is being left open for human prioritization rather than pushed toward auto-implementation — the category classification here (feature/enhancement) keeps it outside the categories this pipeline auto-promotes.


    Labels: The maintainer asked to hold this for human prioritization rather than auto-dispatching it, which the needs-human label makes explicit; existing enhancement/triaged/ready-for-triage labels remain accurate.


    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
    Previous run

    Triage Summary

    Severity: Medium · Category: Feature

    Problem

    When a PR is merged while the review agent is still running, post-review.sh detects the non-OPEN state and posts a generic "Review skipped" message — discarding the agent's entire analysis. This has been observed on at least two PRs in this repo (PR #73 and PR #59), wasting significant compute (opus model, 6 sub-agents, ~5 minutes of inference per run).

    This is distinct from the upstream issue (fullsend#3690), which tracks the pre-script abort case where the PR is merged before the agent starts. This issue covers the mid-execution variant where the PR was OPEN at pre-script time and merged during agent execution — a case that pre-script abort cannot address.

    Root Cause

    The merged-PR early-exit path in post-review.sh (lines 37–53) unconditionally posts a generic skip message and exits without checking whether the agent produced an agent-result.json with findings.

    Recommended Fix

    Modify the PR_STATE != OPEN block to:

    1. Look for agent-result.json using the existing find pattern
    2. If found with a non-empty body (and action is not approve with no findings), post the review body as a PR comment (not a gh pr review) with an informational banner
    3. Skip all outcome label application on non-OPEN PRs
    4. Fall back to the existing generic skip message when no findings exist

    ~20 lines of change in scripts/post-review.sh.

    Proposed Test Case

    Add to scripts/post-review-test.sh:
    
    1. Merged PR + findings (request-changes/comment action with body)
       → body posted as comment with informational banner, no outcome labels
    
    2. Merged PR + approve with no findings
       → existing generic skip message (no regression)
    
    3. Merged PR + no agent-result.json
       → existing generic skip message (no regression)
    
    4. Open PR (any action)
       → full review posting and label path unchanged
    
    5. Closed (not merged) PR + findings
       → informational comment path applies
    

    Labels: This is a feature enhancement to the review pipeline scripts, matching the 'enhancement' label.

  4. fullsend-ai-prioritize commented on Aug 1, 2026

    @fullsend-ai-prioritize

    RICE Priority Score: 1.6

    Score breakdown
    Dimension Score Reasoning
    Reach 1 Affects the development team using this review pipeline. The mid-execution merge pattern has been observed on at least 2 PRs (#73, #59) in this repo and will recur on any fast-merged PR. This is a moderate number of users within one organization's workflow.
    Impact 1 When triggered, the entire review analysis (opus model, 6 sub-agents, ~5 minutes of inference) is silently discarded, meaning potential findings on merged code go unnoticed. However, the PRs are already merged so findings are informational only — the value scales with diff complexity, and trivial PRs would produce low-value approvals. This is a noticeable workflow improvement that recovers otherwise-wasted compute and analysis.
    Confidence 0.8 High confidence. The issue is exceptionally well-described with specific PR references, line numbers in post-review.sh, clear root cause analysis, and detailed validation criteria. The proposed fix is tightly scoped (~20 lines). Two concrete instances demonstrate the pattern. The only uncertainty is whether informational post-merge comments add noise on trivial PRs.
    Effort 0.5 Small, well-scoped change of ~20 lines in scripts/post-review.sh. The issue identifies the exact lines to modify (37-53), the existing find/jq patterns to reuse, and provides 5 specific test cases for post-review-test.sh. No architectural changes or cross-component coordination needed.

    Formula: (1 x 1 x 0.8) / 0.5 = 1.6

  5. ralphbean commented on Sep 23, 2026

    @ralphbean
    Member

    /fs-triage lots of things have changed between when this was originally filed and now across both the https://github.com/fullsend-ai/fullsend and https://github.com/fullsend-ai/agents repos. Is this still relevant? This is a stale-issue review, not an implementation request: even if the issue is still a valid bug and has sufficient information, do not recommend or trigger ready-to-code yet. Leave it for human prioritization after confirming whether it remains relevant. Do not close a still-relevant bug merely to avoid coding it.

  6. fullsend-ai-triage commented on Sep 23, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 5:50 AM UTC · Completed 5:55 AM UTC

    Commit: 6d60955 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $0.43

  7. added
    needs-human
    and removed on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfeatureneeds-humanready-for-triagetriaged

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions