Repository navigation
feat(#9957): fold superseded agent result comments as outdated - #10089
Conversation
|
/fs-fix-stop |
|
Fix agent disabled for this PR. Remove the |
|
🤖 Review · ❌ Terminated · Started 5:51 PM UTC · Ended 6:04 PM UTC Commit: |
Site previewPreview: https://55eb3ae4-site.fullsend-ai.workers.dev Commit: |
|
Risk Assessment: moderate (2/5) DetailsWhile the change spans 31 files with active churn in core CLI and forge packages, risk is moderate due to bot authorship, zero protected or security-sensitive paths touched, strong test coverage, and complete alignment with the linked issue. |
ReviewFindingsLow
Labels: PR changes Go CLI/forge code, docs, and the behaviour test suite. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
🤖 Finished Review · Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.24 This review was superseded by a newer commit. Check the current pull request HEAD's review status before merging. |
|
🤖 Finished Review · ✅ Success · Started 6:43 PM UTC · Completed 6:54 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.47 |
|
Risk Assessment: moderate (2/5) DetailsWhile the change spans 31 files across core CLI and forge packages with elevated git history churn and coupling, risk remains moderate due to bot authorship, zero protected or security-sensitive paths touched, solid test coverage, and complete alignment with the linked issue. |
ReviewFindingsLow
|
Superseded by updated review
|
Finding threads left open (1):
|
waynesun09
left a comment
There was a problem hiding this comment.
Validated: the new review-re-run-minimize scenario passes on the github-emulator (shard i: 7 scenarios passed), unit tests pass, docs checked for facts and prose. LOW follow-up tracked in #10092.
Every agent run now appends its result (#9334), so earlier results stay fully visible and readers scroll past them. When a run posts a result comment, minimize the same author's earlier comments carrying the same marker as OUTDATED, the way post-review already minimizes stale formal reviews. - sticky: new Config.MinimizeSuperseded and MinimizeSuperseded. After the new comment is created, it lists the thread and minimizes the earlier comments whose body starts with the marker and whose author is exactly the new comment's author. The newest comment, other authors' comments and comments posted after it stay visible. It is best effort: failures are logged, never returned. - post-review folds earlier review-agent comments. The stale-head and failure notices keep their own marker and fold nothing, so a request-changes review stays visible until a later review replaces it. - post-comment folds for the risk-assessment, triage-agent and prioritize-agent markers; review-dedup folds earlier skip notes. - forge.Client gains IsCommentMinimized (GitHub GraphQL; GitLab and Forgejo return ErrNotSupported) so a behaviour scenario can assert the fold. GitLab cannot minimize: earlier comments stay visible. - New behaviour scenario re-runs review and asserts one visible review and risk-assessment comment and the earlier ones minimized. - Review, triage and prioritize docs say older results are folded. Note: pre-commit could not fetch hook repos (sandbox TLS), so hooks were run directly; all passed except semgrep, which could not download its pinned ruleset and analyzed nothing. The new behaviour scenario was not run (needs live GitHub pool repos). Closes #9957 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The behaviour step read each comment's minimized state through
node(id:) { ... on Minimizable }. The github-emulator rejects that
fragment and its node() lookup does not resolve IssueComment, so the
review re-run scenario failed on the emulator shard.
Replace IsCommentMinimized(nodeID) with
ListCommentMinimizedStates(owner, repo, number), which pages through
repository.issueOrPullRequest comments (first: 100, after: cursor, at
most 100 pages) and returns isMinimized keyed by comment node ID. The
REST node_id equals the GraphQL id, so the step looks each matching
comment up in the map, and a missing entry is an error. A null
issueOrPullRequest returns ErrNotFound; GitLab and Forgejo still return
ErrNotSupported. The step now reads the thread once instead of once
per comment.
Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
MinimizeSuperseded stopped at the comment whose ID equals the new one. When the new comment's ID was 0, or a lagging listing did not include it yet, the loop never stopped, so a newer same-marker comment from a concurrent run could be folded. Return early when the new comment's ID is unknown (0). Otherwise skip every comment whose ID is at or above it, because GitHub comment IDs increase. The fake client now gives a new comment an ID above every existing comment, as GitHub does, so tests that seed comments still see the new one as the newest. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
Use "minimized as outdated" throughout and say that a minimized comment collapses but can still be expanded. Split review step 4 into inline findings, re-runs and native review, and say that the earlier risk-assessment comments are minimized when the new risk-assessment comment is posted, not when the review comment is. Name ListCommentMinimizedStates in the driver guide. Assisted-by: Claude (fix), Gemini (review) Signed-off-by: Wayne Sun <gsun@redhat.com>
ListCommentMinimizedStates returned a partial map when a page reported hasNextPage with an empty endCursor; return a "missing pagination cursor" error instead, as the review-thread reader does. Say that only a null issueOrPullRequest wraps ErrNotFound (github.com reports a missing number as a GraphQL error), and restore "the newest is not" in the minimized-comments step row. Assisted-by: Claude (fix), DeepSeek (review) Signed-off-by: Wayne Sun <gsun@redhat.com>
28da83d to
585fd7e
Compare
|
🤖 Finished Review · ✅ Success · Started 8:37 PM UTC · Completed 8:49 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.90 |
|
Risk Assessment: moderate (2/5) DetailsWhile the change spans 31 files across core CLI and forge packages with elevated git history churn and coupling, risk remains moderate due to bot authorship, zero protected or security-sensitive paths touched, solid test coverage, and complete alignment with the linked issue. |
|
Looks good to me |
Superseded by updated review
Live check on github.comBuilt Run output: run 2 printed Minimized state from the GraphQL API afterwards:
The behaviour step's Earlier results collapse as "Hidden as outdated"; the plain comment and the newest result stay visible: A hidden result still expands with "show comment": Limit: the comments were posted with a user token, not an agent App token; the App path is covered by the |


Summary
Every agent run appends its result as a new comment (#9334), so a PR with several pushes collects review, risk-assessment and review-skip comments, and readers scroll past every earlier one. This PR applies the existing stale-formal-review handling to those comments too: when a run posts a result comment, the same author's earlier comments with the same marker are minimized as
OUTDATED.Related Issue
Addresses #9957 (blocker #9399 has merged).
Changes
internal/sticky: newConfig.MinimizeSupersededoption and exportedMinimizeSuperseded. After the new comment is created, it lists the thread and minimizes only earlier comments whose body starts with the marker and whose author is exactly the author of the comment just created (the posting identity). The newest comment, other authors' comments and any comment posted after this run's comment stay visible. If the author is unknown, nothing is minimized. This is best effort: a listing or minimize failure is logged and never fails the post.post-review: folds earlierfullsend:review-agentcomments once the new review comment is posted. The stale-head and failure notices usefullsend:review-noticeand explicitly fold nothing, so a request-changes review stays visible until a later review replaces it.post-comment(used by the agents' triage, prioritize and risk-assessment post-scripts on GitHub): folds for thefullsend:risk-assessment,fullsend:triage-agentandfullsend:prioritize-agentmarkers only. Other markers are unchanged.review-dedup --publish: a new skip note folds the bot's earlier skip notes. Progress output goes to stderr so thekey=valuestdout stays parseable.forge.Client.IsCommentMinimized: new method (GitHub via GraphQLMinimizable.isMinimized; GitLab and Forgejo returnErrNotSupported; FakeClient reads recorded minimizes). The behaviour suite needs it to check that a comment is minimized.features/review/review-re-run-minimize.feature(shardi): reviews a PR twice and asserts one visible review comment and one visible risk-assessment comment after each run, with the first run's comments minimized. New steps:the <issue|pull request> has <n> visible comments containing "<text>"andevery comment on the <issue|pull request> containing "<text>" other than the last is minimized. The scenario also uses a newscm.CommentMinimizedReaderdriver extension and a new fixturereview/comment-with-risk.json.docs/agents/review.md,triage.mdandprioritize.mdsay older results are folded as outdated. The behaviour step table and the SCM driver guide are updated too.Testing
internal/sticky(author/marker/prefix filtering, newest kept, later comments kept, dry run, unknown author, list failure, not-supported short-circuit, per-comment failure),internal/cli(post-review folds earlier reviews only; notices fold nothing; post-comment folds only the listed markers; review-dedup folds earlier skip notes and still publishes when listing fails), forge implementations, behaviour steps and feature wiring.go vet ./...clean;go test -raceoninternal/sticky,internal/forge/...,internal/cli/...,pkg/behaviourtest/...pass, plus-tags behaviourforpkg/behaviourtestandinternal/forge. Patch coverage on the new functions is 91–100%.pre-commitcould not fetch remote hook repos in the sandbox (TLS), so the configured hooks were run directly: pre-commit-hooks v6.0.0 checks, gofmt, go vet, gitleaks, lychee, lint-docs-links, lint-interface-doc-sync, lint-broken-symlinks. All passed. semgrep did not run: it could not download its pinned ruleset, and withSEMGREP_REQUIRED=0it analyzed nothing.TestReviewReRunMinimizeFeature_StepsMatchPatterns, andTestShardsCoverEveryScenariopasses.Notes for reviewers
fullsend issues post-comment(tracker path) does not fold anything.tracker.Clienthas no minimize, and the GitHub agents post these markers throughfullsend post-comment/post-reviewtoday. If agents move toissues post-comment --tracker github, a follow-up would need to add minimizing there.isMinimized. This is the same patternminimizeStaleReviewsuses for formal reviews.Checklist
!for breaking changes)🤖 Generated with Claude Code
Closes #9957
Post-script verification
agent/9957-minimize-superseded-comments)9ea54c62a66f89fbcfcd9a36ac38332a97fd2bdd..HEAD)