Skip to content

post-refine.sh: gh issue comment fallback path drops upsert marker #12

Open

Description

@fullsend-ai-retro

What happened

PR #11 removed the <!-- fullsend:refine --> marker from BODY to prevent doubling when fullsend issues post-comment --marker injects it. However, the gh issue comment fallback path (used when the fullsend CLI is unavailable on GitHub issues) writes TMP_BODY without any marker. On a subsequent refine run where the fullsend CLI IS available, post-comment --marker searches for the marker in existing comments, fails to find it (because the fallback posted without one), and creates a duplicate comment instead of upserting. The review agent flagged this as a medium logic-error on PR #11, but the PR was merged without addressing it.

What could go better

This is a real functional defect, though it requires a specific sequence to trigger: (1) the fullsend CLI must be unavailable on one run (forcing the gh issue comment fallback), then (2) available on a subsequent run (using post-comment --marker which expects to find the marker). The practical risk depends on how reliably the fullsend CLI is installed in the review runner environment. If it's always present, the fallback never fires and the bug is latent. If CLI availability is inconsistent, duplicate comments will appear on GitHub issues. Confidence: high that the bug exists in the code; moderate that it will trigger in practice.

Proposed change

In .fullsend/scripts/post-refine.sh, prepend the marker to TMP_BODY only in the gh issue comment fallback branch (around line 164, inside the if [[ "${posted}" -ne 1 ]] block for the GitHub case). This ensures the fallback path writes a marker-bearing comment that fullsend issues post-comment --marker can find later, without doubling the marker on the primary fullsend CLI path. Example: before writing TMP_BODY to gh issue comment, prepend ${MARKER}\n to the file content.

Validation criteria

After the fix, run a GitHub-targeted refine cycle with the fullsend CLI deliberately absent (to exercise the fallback path), then run a second cycle with the CLI present. The second run should update the existing comment in-place rather than creating a duplicate.


Generated by retro agent from #11

Activity

  1. fullsend-ai-triage commented on Aug 31, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 10:37 PM UTC · Completed 10:40 PM UTC

    Commit: 1aecacd · View workflow run →

    Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $0.67

  2. fullsend-ai-triage commented on Aug 31, 2026

    @fullsend-ai-triage

    Code inspection of post-refine.sh confirms the defect. The relevant code flow in the github case:

    1. Primary path (lines ~155-162): fullsend issues post-comment --marker — the CLI injects the marker into the comment server-side.
    2. Fallback path (lines ~163-166): gh issue comment --body-file — writes TMP_BODY which contains BODY, but BODY deliberately omits the marker (per the comment on line ~118).

    The asymmetry means a fallback-posted comment is invisible to future --marker upsert lookups.

    Recommended fix: Prepend ${MARKER} to TMP_BODY inside the fallback block before the gh issue comment call.

    Related: Issue #13 also targets post-refine.sh (GHA command sanitization) — independent concern, no conflict expected.

    # Proposed test scenario
    1. Remove fullsend from PATH, run post-refine.sh targeting a test issue
       -> assert posted comment contains <!-- fullsend:refine -->
    2. Restore fullsend to PATH, run post-refine.sh again
       -> assert comment was upserted (count == 1), not duplicated
    

    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  3. fullsend-ai-coder commented on Aug 31, 2026

    @fullsend-ai-coder

    🤖 Finished Code · ✅ Success · Started 10:42 PM UTC · Completed 10:47 PM UTC

    Commit: 1aecacd · View workflow run →

    Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.58

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

    bugSomething isn't workingready-for-triageTriggers triage agent dispatchready-to-codeTriggers code agent dispatch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions