Repository navigation
Description
Problem
ListPullRequestReviewThreads reads GitLab discussion paths and line numbers but discards the position's base_sha, start_sha, and head_sha. Consequently, ReviewThread.IsOutdated is always unknown for GitLab, and a position from an older diff can be presented without indicating whether it maps to the current MR diff.
This prevents downstream consumers from safely using stamped GitLab discussions as stable finding-identity anchors. In fullsend-ai/agents, stamped-thread mapping is therefore GitHub-only, and a GitLab finding may receive a new ID when its line moves.
fullsend#7328 and PR fullsend#7342 added getMergeRequestDiffRefs and used the refs when creating positioned GitLab discussions. They did not update the discussion-reading path in ListPullRequestReviewThreads.
GitLab traces diff-note positions after pushes when it can map them. Its DiffPositionableNote#active? check considers a note current when the position's diff refs equal the MR's current diff_refs. No client-side diff reconstruction should be necessary.
Requested change
Update the GitLab implementation of ListPullRequestReviewThreads to:
- Fetch the MR's current
diff_refsonce. - Decode
base_sha,start_sha, andhead_shafrom each discussion position. - Set
is_outdated: falseonly when the complete position refs match the current MR refs. - Set
is_outdated: truewhen the complete position refs differ. - Leave
is_outdatedunknown when either set of refs is incomplete or unavailable. - Expose
lineandstart_lineas current positions only when the position is confirmed current. Do not expose a stale position as a current line. - Preserve the existing discussion ID, resolution, author-verification, pagination, side, and multiline behavior.
getMergeRequestDiffRefs already exists in the GitLab adapter and can provide the current refs.
Acceptance criteria
- A discussion traced to the current diff returns
is_outdated: falsewith its remapped current path and line. - A discussion whose position belongs to an older diff returns
is_outdated: truewithout a currentlineorstart_line. - Missing or unavailable refs fail closed and are not treated as trusted current positions.
- Tests cover:
- a line shifted by an earlier insertion;
- an untraceable or outdated position;
- incomplete diff refs;
- renamed files;
- multiline discussions;
- failure to fetch the current MR refs.
- The forge-neutral
ReviewThreadcontract and GitLab tests no longer state that GitLab always lacks outdated state.
Downstream follow-up
Once this is available, fullsend-ai/agents can extend stamped-thread finding-ID mapping to GitLab. It should trust only discussions with is_outdated: false, verify the comment author, and mint a new ID for outdated, unknown, ambiguous, or truncated mappings.
Related:
- fullsend#7328
- fullsend#7342
- fullsend#9446
- fullsend#8749
- review: preserve finding IDs across shifted lines and never reuse them for different findings agents#1818
- fix(#1818): keep finding ids on their stamped review threads agents#1819
- feat(gitlab): implement forge_resolve_outdated_review_threads via discussions api agents#2002
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn progress
Activity
fullsend-ai-triage commentedon Nov 19, 2026
🤖 Finished Triage · ✅ Success · Started 10:28 AM UTC · Completed 10:30 AM UTC
Commit:
d0dd3f3· View workflow run →Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.10
fullsend-ai-triage commentedon Nov 19, 2026
Triage found this issue actionable as written; the requested change and acceptance criteria are specific enough to start implementation.
Verified in the repo
getMergeRequestDiffRefsand the GitLabListPullRequestReviewThreadsboth live ininternal/forge/gitlab/mr.go, so the refs helper can be reused directly.ReviewThread.IsOutdateddoc comment ininternal/forge/forge.go, and the GitLab position-contract test ininternal/forge/gitlab/methods_test.go, currently state that GitLab never exposes outdated state. Both need updating as part of this change.Design points to settle during implementation
is_outdated, no trusted current line) rather than guessing. Choose consistently whether it also surfaces an error, and cover the choice in a test.lineandstart_linetogether, or omit them together, so a half-current range is never reported.Proposed test case
This is categorized as a feature (new behavior, not a regression), so it is not auto-promoted to ready-to-code and is left for a maintainer to schedule.
Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidancecsoceanu commentedon Nov 19, 2026
/fs-code Implement this issue as written. Reuse getMergeRequestDiffRefs and fetch the current MR refs only once. If that fetch fails or either ref set is incomplete, keep returning the threads but set IsOutdated to nil and omit Line/StartLine rather than guessing. For multiline discussions, expose both line values or neither. Preserve pagination, resolution, author verification, side handling, and existing error behavior. Please add the table-driven tests suggested by triage and keep the change limited to the GitLab discussion-reading path and forge-neutral contract updates.
fullsend-ai-coder commentedon Nov 19, 2026
🤖 Finished Code · ✅ Success · Started 10:56 AM UTC · Completed 11:09 AM UTC
Commit:
d0dd3f3· View workflow run →Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $1.77