Skip to content

Fix agent should reconcile duplicate finding threads across runs #2210

Done

Description

@ifireball

Parent

Review and fix agents should reconcile finding threads #478

What to build

Teach the fix-agent lifecycle to reconcile multiple open GitHub review threads that carry the same stable finding ID across review runs. Today, a structured fix action identifies a finding ID and disposition, but when more than one open bot-authored thread has that stamp, the post-script reports an ambiguous match and changes none of them.

On fullsend #9891, fix iteration 3 left eight finding actions untouched for this reason. The review-side duplicate handling in agents #2197 / PR #2204 does not handle the fix-agent path.

Use the matching thread history to identify the current thread and any stale copies. For fixed or declined, explain and resolve the current thread, and post an idempotent pointer to the current thread before resolving each proven stale copy. For needs_human, leave the current thread open with the explanation and resolve only stale copies that can be identified safely. If the history is inconclusive, leave the affected thread open and report each direct thread link with the next action.

Acceptance criteria

  • A single action for a stable finding ID can reconcile multiple matching open bot-authored threads; multiple matches are not automatically abandoned as ambiguous.
  • The fix lifecycle identifies the current thread and stale copies from cross-run thread history, consistent with the review agent's duplicate-thread handling.
  • fixed and declined actions receive explanatory, idempotent replies and resolve the current thread and any proven stale copies.
  • needs_human leaves the current thread open while allowing proven stale copies to be explained and resolved.
  • Existing safeguards remain: threads with unseen human replies, incomplete history, changed PR head, or uncertain ownership are left open and individually listed with working links and next steps; thread API failures do not fail the run.
  • Regression coverage includes multiple open threads with one ID across runs, fixed/declined/needs-human dispositions, safe stale-copy identification, inconclusive history, idempotent reruns, and per-thread failure reporting.

Activity

  1. added
    bug
    on Nov 30, 2026
  2. self-assigned this
    on Nov 30, 2026
  3. fullsend-ai-triage commented on Nov 30, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 11:40 AM UTC · Completed 11:42 AM UTC

    Commit: ef1bb84 · View workflow run →

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

  4. added
    ready-to-code
    on Nov 30, 2026
  5. fullsend-ai-triage commented on Nov 30, 2026

    @fullsend-ai-triage

    Triage

    The cause is in the fix post-script, scripts/process-fix-result.py. When more than one unresolved owned thread matches a finding ID, it reports the action as ambiguous and returns without changing any thread. It has no concept of a current thread versus stale copies.

    The review side already has a model to follow. PR #2204 (merged, for #2197) added a classifier in scripts/pre-review.sh. It treats the newest owned thread as current and the other open ones as stale. When no single newest thread can be determined, it reports every open thread as ambiguous. The fix path can reuse that design and keep its existing per-thread safeguards.

    Scope notes

    • scripts/pre-fix.sh and scripts/post-fix.sh also compute an ambiguous flag for duplicate IDs, so they likely need a matching update.
    • docs/fix.md and agents/fix.md should be checked for text describing the old ambiguous behavior.
    • No workflow files are involved.
    • No open PR addresses this issue, and no open duplicate was found.

    Proposed test case

    Given open bot threads T1 (older), T2 (newer) sharing finding f_x
    - action fixed/declined -> reply+resolve T2; pointer reply to T2, then resolve T1
    - action needs_human   -> reply on T2, T2 stays open; T1 explained and resolved
    - tied/unreadable timestamps -> nothing resolved; each thread listed with link and next step
    - stale thread with unseen human reply / incomplete history / changed head -> left open and listed
    - rerun -> no duplicate replies or pointers
    - API failure on one thread -> reported for that thread; run succeeds; other threads still processed
    

    This is ready for implementation.


    Next steps:

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

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 11:44 AM UTC · Completed 11:55 AM UTC

    Commit: ef1bb84 · View workflow run →

    Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $2.72

  7. added 5 commits that reference this issue on Nov 30, 2026
  8. added a commit that references this issue on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugfix-agentready-to-code

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions