Skip to content

[3689 by Claude Opus 5.5] Repeated and contradictory bot comments: rate limit, cancelled, started, failed - #3712

Merged
integry merged 4 commits into
3686-epic-0-9-g6ifrom
3689/claude-opus-5-5-repeated-and-contradictor-20261118-1444-hy5
Nov 18, 2026
Merged

integry merged 4 commits into
3686-epic-0-9-g6ifrom
3689/claude-opus-5-5-repeated-and-contradictor-20261118-1444-hy5

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3689

Branch: 3689/claude-opus-5-5-repeated-and-contradictor-20261118-1444-hy5
Commits: ✅ Changes committed (a22cefc)


AI Processing Completed

Execution Details:

Summary:
The four repeated notices (rate limit, cancelled, started, merge-conflict failure) now post once and update that comment on a repeat. The rate-limit notice also shows the correct reset time. Typecheck and lint (--max-warnings 0) pass, and the 16 related suites pass, including 11 new tests.

Shared helper (src/jobs/repeatedNoticeComment.ts)

  • It works like ciFailureCommentGrouping.ts. Each notice ends with a hidden marker: <!-- propr:notice kind="…" key="…" count="N" -->.
  • The key is built from the notice kind, a scope (task id, issue, or head commit) and the notice text with timestamps removed.
  • Before posting, it reads the thread once. If one of ProPR's own comments has the same marker, it edits that comment instead: latest text, plus a line _Reported N times; last at <time> UTC._.
  • It never edits a person's comment that happens to contain the marker. It can ignore earlier notices older than a set time window.
  • If reading or editing fails, it posts a new comment, so no notice is lost. Like the CI-failure grouping, two notices arriving at the same moment can still both post.

Where it is used

  • Rate limit (errorHandlers.ts): one notice per issue within 12 hours. Later retries and sibling runs hitting the same limit update it with the newest reset time.
    • No notice is posted when the retry is due within 2 minutes.
  • Execution Cancelled (errorHandlers.ts): one notice per issue within 10 minutes, so the several handlers and sibling runs that report one stop produce a single comment.
  • "AI processing has started" (issueJob/worktree.ts): grouped by task id. A rate-limit retry keeps the same task id, so it updates the existing start notice instead of announcing a new run, including on an issue that by then has its PR and AI-done. A different task (another model, a new request) still posts its own.
    • The updated start comment ends with "Reported 3 times", which reads a little oddly on a start notice.
  • Failed to resolve merge conflicts (processMergeConflictJob.ts): grouped by head SHA plus the error text. If an identical failure on that head was already reported, that report is updated and this attempt's "Auto-resolving…" comment is deleted. If the delete fails, that comment is rewritten with the failure text.

Reset time, fixed at the source (packages/core/src/utils/scheduling.ts)

  • The parser only understood a bare time (resets 1am (UTC)). A weekly message like resets Nov 20, 1am (UTC) failed to parse and fell back to "next hour + 2 min". That was the weekly limit shown with an hourly reset.
  • It now reads dated resets ("Nov 20, 1am" and "Nov 20 at 10am"), named time zones, and a December reset that falls in January.
  • When a message lists several limits, it uses the reset of the one described as hit or reached.
  • The displayed reset time now includes the date when it is more than 20 hours away (e.g. Nov 20, 1:00 AM UTC).

Tests

  • New: test/repeatedNoticeComment.test.ts (helper, rate limit, weekly reset, immediate retry, cancellation) and test/issueStartNotice.test.ts (start notice).
  • Extended: test/processMergeConflictJob.test.ts (three identical failures leave one comment) and test/scheduling.test.ts (weekly, five-hour, multiple-limit and time-zone parsing).
  • I updated the GitHub fakes in two existing tests because the code now reads comments before posting.

Open questions

  • Rate limit on another account: I couldn't find a path where an issue run moves to another account after a usage limit. Synthetic agents already switch members within the same attempt without posting anything. So I used the 2-minute rule above as the check for an immediate retry. If the retry on another account happens somewhere I didn't find, that place needs to tell the handler.
  • Rate limit grouping: grouping is per issue rather than per task, because the four comments on Official plugin: Linear (start work from a ticket, keep the ticket in sync) #3556 may have come from sibling runs with different task ids.
  • Merge conflicts: the per-head grouping covers only this system-triggered failure comment.

No previews, since nothing here is visual.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (5 files)
    • packages/core/src/utils/scheduling.ts (+85/−35)
    • src/jobs/errorHandlers.ts (+36/−19)
    • src/jobs/issueJob/worktree.ts (+6/−3)
    • src/jobs/processMergeConflictJob.ts (+9/−8)
    • src/jobs/repeatedNoticeComment.ts (added, +213/−0)
  • Low risk (6 files)
    • test/issueStartNotice.test.ts (added, +85/−0)
    • test/issueUsageLimitRetry.test.ts (+2/−2)
    • test/processMergeConflictJob.test.ts (+35/−0)
    • test/repeatedNoticeComment.test.ts (added, +175/−0)
    • test/scheduling.test.ts (+33/−0)
    • test/taskSubmissionLifecycle.test.ts (+1/−0)

Diff size: 11 files changed, +680/−67 lines

View task for the run's logs and conversation.


This PR was created automatically by ProPR after processing issue #3689.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…lict failure) now post once and update that comment on a repeat. The rate-limit notice also shows the correct reset time. Typecheck and lint (`--max-warnings 0`) pass, and the 16 related suites pass, including 11 new tests.

Shared helper (`src/jobs/repeatedNoticeComment.ts`)
- It works like `ciFailureCommentGrouping.ts`. Each notice ends with a hidden marker: `<!-- propr:notice kind="…" key="…" count="N" -->`.
- The key is built from the notice kind, a scope (task id, issue, or head commit) and the notice text with timestamps removed.
- Before posting, it reads the thread once. If one of ProPR's own comments has the same marker, it edits that comment instead: latest text, plus a line `_Reported N times; last at <time> UTC._`.
- It never edits a person's comment that happens to contain the marker. It can ignore earlier notices older than a set time window.
- If reading or editing fails, it posts a new comment, so no notice is lost. Like the CI-failure grouping, two notices arriving at the same moment can still both post.

Where it is used
- Rate limit (`errorHandlers.ts`): one notice per issue within 12 hours. Later retries and sibling runs hitting the same limit update it with the newest reset time.
  - No notice is posted when the retry is due within 2 minutes.
- Execution Cancelled (`errorHandlers.ts`): one notice per issue within 10 minutes, so the several handlers and sibling runs that report one stop produce a single comment.
- "AI processing has started" (`issueJob/worktree.ts`): grouped by task id. A rate-limit retry keeps the same task id, so it updates the existing start notice instead of announcing a new run, including on an issue that by then has its PR and `AI-done`. A different task (another model, a new request) still posts its own.
  - The updated start comment ends with "Reported 3 times", which reads a little oddly on a start notice.
- Failed to resolve merge conflicts (`processMergeConflictJob.ts`): grouped by head SHA plus the error text. If an identical failure on that head was already reported, that report is updated and this attempt's "Auto-resolving…" comment is deleted. If the delete fails, that comment is rewritten with the failure text.

Reset time, fixed at the source (`packages/core/src/utils/scheduling.ts`)
- The parser only understood a bare time (`resets 1am (UTC)`). A weekly message like `resets Nov 20, 1am (UTC)` failed to parse and fell back to "next hour + 2 min". That was the weekly limit shown with an hourly reset.
- It now reads dated resets ("Nov 20, 1am" and "Nov 20 at 10am"), named time zones, and a December reset that falls in January.
- When a message lists several limits, it uses the reset of the one described as hit or reached.
- The displayed reset time now includes the date when it is more than 20 hours away (e.g. `Nov 20, 1:00 AM UTC`).

Tests
- New: `test/repeatedNoticeComment.test.ts` (helper, rate limit, weekly reset, immediate retry, cancellation) and `test/issueStartNotice.test.ts` (start notice).
- Extended: `test/processMergeConflictJob.test.ts` (three identical failures leave one comment) and `test/scheduling.test.ts` (weekly, five-hour, multiple-limit and time-zone parsing).
- I updated the GitHub fakes in two existing tests because the code now reads comments before posting.

Open questions
- Rate limit on another account: I couldn't find a path where an issue run moves to another account after a usage limit. Synthetic agents already switch members within the same attempt without posting anything. So I used the 2-minute rule above as the check for an immediate retry. If the retry on another account happens somewhere I didn't find, that place needs to tell the handler.
- Rate limit grouping: grouping is per issue rather than per task, because the four comments on #3556 may have come from sibling runs with different task ids.
- Merge conflicts: the per-head grouping covers only this system-triggered failure comment.

No previews, since nothing here is visual.
@propr-dev

propr-dev Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=3
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 18, 2026
@propr-dev

propr-dev Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 3)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-dev[bot]

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

This PR consolidates repeated notices through a shared marker-based helper and expands reset-time parsing. It needs changes before merge: named-zone parsing can loop indefinitely, rate-limit fingerprints still distinguish changing reset times, and merge-failure grouping uses the queued rather than resolved head.

✅ Stable start-notice identity — Start notices use the task ID and a fixed fingerprint, allowing branch details to change without creating another notice.

✅ Useful fallback coverage — Added tests cover comment read/edit failures, cancellation grouping, and removal of redundant merge-attempt comments.

✅ Clearer weekly reset display — Distant reset timestamps now include the date.

This review is based on the supplied code; no commands were run. Current checks are pending, with no reported failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Named-zone parsing can loop indefinitely

  • Category: correctness

  • Required behavior: Reset parsing must terminate and return the next occurrence of the reported wall-clock time.

  • Evidence: packages/core/src/utils/scheduling.ts:resetClauseTimestamp, specifically the first while (resetMs <= nowMs) loop.

    1. At 2026-11-16T16:57:00Z, parse resets 1am (Europe/Riga).
    2. The initial conversion produces 2026-11-15T23:00:00Z, because Riga is two hours ahead of UTC.
    3. Adding 24 hours produces November 16 at 23:00 UTC. Extracting that instant’s UTC date and converting November 16 at 01:00 Riga produces November 15 at 23:00 UTC again.
    4. Every iteration repeats the same value, so parsing never returns. The provider stream’s rate-limit handler cannot throw its UsageLimitError, and the synchronous loop blocks the worker’s event loop.

    static trace: The supplied provider caller invokes this parser synchronously. There is no iteration bound or progress check. The added Riga test uses 5pm, which does not cross the UTC date boundary and therefore misses this failure.

  • Minimum fix: Advance a calendar date in the target zone independently of the converted UTC instant, then convert each candidate to UTC. Add a regression for an early-morning positive-offset reset whose occurrence has passed.

F2: 🔴 Reset-time changes still split rate-limit notices

  • Category: correctness

  • Required behavior: Repeated notices for the same issue and limit within the grouping window must update the existing notice with the newest reset time.

  • Evidence: src/jobs/errorHandlers.ts:postRateLimitNotice, the fingerprint assignment.

    1. One run reports You've hit your limit · resets 11am (UTC) and creates a rate-limit comment.
    2. Within 12 hours, a retry or sibling reports the same limit with resets 1pm (UTC).
    3. Replacing digits produces resets #am (UTC) and resets #pm (UTC). These remain different after normalizeNoticeText, so the helper calculates different keys.
    4. A second waiting notice is posted instead of updating the first, leaving separate reports and potentially conflicting reset times.

    static trace: The shared normalizer only recognizes numeric clock times; it cannot remove these already-replaced placeholders. Changing from 1pm to 1:30pm likewise changes the fingerprint. The added rate-limit test always uses the same pm format, so it does not exercise either case.

  • Minimum fix: Remove or canonicalize the complete reset clause before generating the fingerprint, while preserving the identity of the limit. Cover meridiem and optional-minute changes.

F3: 🔴 Merge failures use stale head identity

  • Category: correctness

  • Required behavior: Merge-failure notices must group by the head actually processed, keeping distinct heads separate and combining identical failures on the same head.

  • Evidence: src/jobs/processMergeConflictJob.ts:processAdmittedMergeConflictJob, the changed handleMergeJobError call passing headSha.

    1. A job is queued for head A. Before execution, the PR moves to head B.
    2. resolveMergeJobHead explicitly resolves B, and the job prepares and attempts work against the live PR.
    3. The attempt fails, but the catch block passes the original job.data.headSha A into the notice helper.
    4. A later job queued for B fails identically on B. Its key differs from the first report’s key, so two reports remain for the same failure on the same processed head. Conversely, an existing failure for A can be updated with B’s failure.

    static trace: The resolved head.headSha is never assigned to the identity used by the changed error path. The PR lock serializes execution but does not refresh queued metadata. The new test repeats an unchanged queued head and misses this case.

  • Minimum fix: Track the resolved head outside the inner try block and use it for failure grouping after resolution, retaining the queued head only when resolution has not succeeded.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Verify the comment’s app identity

findRepeatedNotice accepts every author with user.type === 'Bot', although its comment promises to select only the app’s own comments. The existing CI grouping helper instead checks known bot usernames. Reusing that identity check would avoid selecting another bot’s quoted marker. This is optional hardening here because the supplied context does not establish a reachable foreign-bot comment and successful cross-author edit.

Score

The implementation has useful coverage and a focused shared helper, but the parser hang and two grouping defects require correction. Pending checks do not resolve these statically demonstrated failures.

Score: 5/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 49s
  • Tokens: 58,779 (57,226 in / 1,553 out)
  • Cost: $0.52

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 F2 F3 S1

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit bc0740b

Addressed 1 AI review comment (IDs: 6982515159)

Addressed findings F1, F2, F3

Summary of Changes

I fixed F1, F2 and F3, and each has a regression test. I ran each new test against the previous code. The scheduling suite hung there until killed, and the other new tests failed, so they catch the defects.

F1: reset parsing could loop forever (packages/core/src/utils/scheduling.ts)

  • Cause: for a reset given only as a time, each next-day candidate was built from the UTC date. In a zone ahead of UTC, an early-morning reset that had already passed kept producing the same instant. For example, resets 1am (Europe/Riga) at 16:57 UTC never returned.
  • Fix: the parser now takes the current date in the reset's own time zone and checks a few calendar days around it there. It converts each one to UTC and returns the first that is still in the future. The loop is bounded and can no longer repeat.
  • Tests in test/scheduling.test.ts:
    • the case from the finding (Riga 1am at 16:57 UTC, giving Nov 16 23:00 UTC).
    • Tokyo 1:30am.
    • a moment when Riga's date is already a day ahead of UTC.
    • a zone behind UTC (New York 11pm).
  • Also checked: the only other caller is the provider rate-limit handler, through parseResetTimeFromMessage. Dated resets never had this loop. That caller's test (claudeRateLimitPropagation) still passes.

F2: a new reset time split the rate-limit notice (src/jobs/errorHandlers.ts)

  • Fix: the new rateLimitNoticeFingerprint replaces the whole "resets …" clause (optional date, time with optional minutes, am/pm, optional zone) with a placeholder, then replaces any remaining digits as before. The rest of the text is kept, so a weekly limit and a session limit still get separate notices.
  • Tests in test/repeatedNoticeComment.test.ts:
    • four reports in a row (11am → 1pm → 1:30pm → Nov 20, 1am (Europe/Riga)) end up as one comment showing the newest text and "Reported 4 times".
    • direct checks that the reset clause is dropped and different limits stay apart.
  • Design note: I put the pattern in errorHandlers.ts rather than exporting it from core. Root test suites mock @propr/core with a fixed list of exports, and a new export could break them. As a result, the pattern now exists in two places, matching the forms the parser reads.

F3: merge failures were grouped by the queued head (src/jobs/processMergeConflictJob.ts)

  • Fix: a processedHeadSha variable starts as the queued head and takes the live head as soon as it is resolved. The failure notice now uses it.
  • Test in test/processMergeConflictJob.test.ts:
    • a job queued for an old head and a job queued for the live head fail the same way and share one report.
    • after the PR moves to a new head, the next failure posts a separate report and the earlier one is left alone.
  • Also checked: this is the only place in the PR that groups by head, so there was nothing else to correct.

To keep processMergeConflictJob.ts under the 400-line lint limit, I merged one nearby statement onto a single line.

Typecheck passes for the root and for packages/core, and lint passes with --max-warnings 0 on the changed files. These suites pass:

Suite Tests passing
scheduling 21
repeatedNoticeComment 11
processMergeConflictJob 26
issueStartNotice 2
issueUsageLimitRetry 16
claudeRateLimitPropagation 1

Nothing here is visual, so there are no previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (3 files)
    • packages/core/src/utils/scheduling.ts (+7/−7)
    • src/jobs/errorHandlers.ts (+13/−1)
    • src/jobs/processMergeConflictJob.ts (+4/−5)
  • Low risk (3 files)
    • test/processMergeConflictJob.test.ts (+36/−5)
    • test/repeatedNoticeComment.test.ts (+26/−1)
    • test/scheduling.test.ts (+11/−0)

Diff size: 6 files changed, +97/−19 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 7m 43s
  • Tokens: 1,887,228 (1,873,731 in / 13,497 out)
  • Cost: $1.01

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…n each new test against the previous code. The scheduling suite hung there until killed, and the other new tests failed, so they catch the defects.

I fixed F1, F2 and F3, and each has a regression test. I ran each new test against the previous code. The scheduling suite hung there until killed, and the other new tests failed, so they catch the defects.

**F1: reset parsing could loop forever** (`packages/core/src/utils/scheduling.ts`)
- **Cause:** for a reset given only as a time, each next-day candidate was built from the UTC date. In a zone ahead of UTC, an early-morning reset that had already passed kept producing the same instant. For example, `resets 1am (Europe/Riga)` at 16:57 UTC never returned.
- **Fix:** the parser now takes the current date in the reset's own time zone and checks a few calendar days around it there. It converts each one to UTC and returns the first that is still in the future. The loop is bounded and can no longer repeat.
- **Tests** in `test/scheduling.test.ts`:
  - the case from the finding (Riga 1am at 16:57 UTC, giving Nov 16 23:00 UTC).
  - Tokyo 1:30am.
  - a moment when Riga's date is already a day ahead of UTC.
  - a zone behind UTC (New York 11pm).
- **Also checked:** the only other caller is the provider rate-limit handler, through `parseResetTimeFromMessage`. Dated resets never had this loop. That caller's test (`claudeRateLimitPropagation`) still passes.

**F2: a new reset time split the rate-limit notice** (`src/jobs/errorHandlers.ts`)
- **Fix:** the new `rateLimitNoticeFingerprint` replaces the whole "resets …" clause (optional date, time with optional minutes, am/pm, optional zone) with a placeholder, then replaces any remaining digits as before. The rest of the text is kept, so a weekly limit and a session limit still get separate notices.
- **Tests** in `test/repeatedNoticeComment.test.ts`:
  - four reports in a row (11am → 1pm → 1:30pm → `Nov 20, 1am (Europe/Riga)`) end up as one comment showing the newest text and "Reported 4 times".
  - direct checks that the reset clause is dropped and different limits stay apart.
- **Design note:** I put the pattern in `errorHandlers.ts` rather than exporting it from core. Root test suites mock `@propr/core` with a fixed list of exports, and a new export could break them. As a result, the pattern now exists in two places, matching the forms the parser reads.

**F3: merge failures were grouped by the queued head** (`src/jobs/processMergeConflictJob.ts`)
- **Fix:** a `processedHeadSha` variable starts as the queued head and takes the live head as soon as it is resolved. The failure notice now uses it.
- **Test** in `test/processMergeConflictJob.test.ts`:
  - a job queued for an old head and a job queued for the live head fail the same way and share one report.
  - after the PR moves to a new head, the next failure posts a separate report and the earlier one is left alone.
- **Also checked:** this is the only place in the PR that groups by head, so there was nothing else to correct.

To keep `processMergeConflictJob.ts` under the 400-line lint limit, I merged one nearby statement onto a single line.

Typecheck passes for the root and for `packages/core`, and lint passes with `--max-warnings 0` on the changed files. These suites pass:

| Suite | Tests passing |
|---|---|
| `scheduling` | 21 |
| `repeatedNoticeComment` | 11 |
| `processMergeConflictJob` | 26 |
| `issueStartNotice` | 2 |
| `issueUsageLimitRetry` | 16 |
| `claudeRateLimitPropagation` | 1 |

Nothing here is visual, so there are no previews.

PR: #3712
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR consolidates repeated notices and improves dated reset parsing with focused regression coverage. It needs localized corrections before merge.

✅ Stable retry identity — Start notices use the task ID, preserving grouping across rate-limit retries while separating different tasks.

✅ Processed-head grouping — Merge-failure reports use the resolved live head, with tests covering stale queued SHAs.

✅ Reset-time coverage — Tests cover weekly dates, multiple limits, and time zones whose local date differs from UTC. The supplied current-head status reports 17 passed checks and no failed or pending checks.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F4: 🔴 Verify ownership before selecting comments

  • Category: correctness

  • Required behavior: Repeated notices must update ProPR’s own comments, preserving other authors’ comments and reliably finding the existing ProPR notice.

  • Evidence: src/jobs/repeatedNoticeComment.ts:findRepeatedNotice — the ownership check accepts every account with user.type === 'Bot'.

    1. A thread contains a matching ProPR notice, followed by another bot’s comment quoting that notice, including its hidden marker.
    2. Both comments pass the ownership and marker checks. The loop selects the later, unrelated bot comment.
    3. publishRepeatedNotice attempts to replace that comment. If editing is permitted, it overwrites another bot’s content. If editing is refused, it posts a new notice instead of updating the existing ProPR notice.

    The marker is copied text, not proof of authorship. The edit-failure fallback preserves delivery but does not recover the correct matching comment. The supplied sibling implementation, scanCiFailureComments, checks an explicit bot-username set; this helper does not. static trace: traced selection through the PATCH and fallback paths. The existing ownership test covers human accounts only.

  • Minimum fix: Match the authenticated ProPR bot identity or configured ProPR bot usernames before accepting a marker. Add a regression with a valid ProPR notice followed by another bot quoting its marker.

F5: 🔴 Include recent comments beyond the pagination cap

  • Category: correctness

  • Required behavior: Sequential repeats must find and update their earlier notice rather than continually create new comments.

  • Evidence: src/jobs/repeatedNoticeComment.ts:listThreadComments — pagination stops at MAX_COMMENT_PAGES = 10, reading only the first 1,000 comments.

    1. An issue or PR already has 1,000 comments before its first notice from this helper.
    2. The helper scans those comments and publishes the notice after them.
    3. Every subsequent identical report scans the same first 1,000 comments, never sees the notice, and publishes another comment.

    This permanently disables grouping for new notices on sufficiently long threads, including repeated merge failures and start notices. Neither time-window filtering nor fallback handling addresses the omitted tail; all requests can succeed. static trace: traced the bounded pagination loop through findRepeatedNotice and the no-match publication path. The new fake-thread tests do not exercise a notice beyond page ten.

  • Minimum fix: Paginate through the thread, or implement a bounded lookup that actually includes the newest comments. Add a regression where the matching notice appears after the first 1,000 comments.

Suggestions

These are optional follow-ups and are not sent to /fix.

S2: 🟢 Exercise cleanup fallback behavior

Add a test where deleting the redundant merge-attempt comment fails and rewriting it succeeds. The implementation includes this useful recovery path, but the added tests cover only successful deletion. This is optional coverage, not a demonstrated defect.

Score

The approach and passing checks provide useful confidence, but comment ownership and pagination leave deterministic gaps in the central grouping behavior. Both can be corrected without redesigning the PR.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 38s
  • Tokens: 63,518 (62,452 in / 1,066 out)
  • Cost: $0.57

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F4 F5 S2

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit b11909e

Addressed 1 AI review comment (IDs: 6983429581)

Addressed findings F4, F5

Summary of Changes

I fixed F4 and F5 in src/jobs/repeatedNoticeComment.ts and added a regression test for each. Both new tests fail against the previous version of the helper and pass now.

F4: ownership check. findRepeatedNotice used to accept any comment whose author was a bot account. It now accepts only comments posted by ProPR's own bot account. That account comes from the new proprBotUsernames(), which reads it the same way scanCiFailureComments does: the detected bot name, then GITHUB_BOT_USERNAME, then propr-dev[bot]. Another app's comment that quotes the hidden marker is now skipped, so the earlier ProPR notice is the one that gets updated.

  • Many test suites replace @propr/core with a stand-in that doesn't include the function that returns the bot name. The helper looks that function up through the whole module, so those suites still load and fall back to the configured and default names.
  • All three places that publish these notices go through this one function (errorHandlers.ts, issueJob/worktree.ts, processMergeConflictJob.ts). No other code in this PR chooses comments by bot type, so there was nowhere else to fix.

F5: comments past the 1,000 cap. The 10-page limit is gone, and the helper now reads the whole thread, so a notice posted after the first 1,000 comments is found again on the next repeat. When a notice has a time window, the read passes GitHub's since filter, so only comments changed inside that window are fetched. The existing time check still runs as well.

Tests (in test/repeatedNoticeComment.test.ts):

  • The fake thread now splits comments into pages of 100 and honours since.
  • The F4 test has a ProPR notice followed by another bot's comment quoting it. The ProPR notice is updated to a count of 2 and the other comment is left alone.
  • The F5 test has 1,050 earlier comments. Three identical reports leave one notice with a count of 3, both with and without a time window.
  • The fake GitHub comments in test/issueStartNotice.test.ts and test/processMergeConflictJob.test.ts now carry a propr-dev[bot] login, since the check now goes by account name.

Checks: the typecheck passes and lint passes with zero warnings. I split findRepeatedNotice into small helpers to get under the lint complexity limit. The six related suites pass: repeatedNoticeComment 13/13, issueStartNotice, processMergeConflictJob, issueUsageLimitRetry, taskSubmissionLifecycle and prContinuation. I ran the last three before the final helper split, which only moved code around.

Reading the whole thread means a notice on a very long thread costs one request per 100 comments when no time window is set. Two identical notices arriving at the same moment can still both post, as before. That race comes from GitHub's API and isn't something this change can close.

Nothing here is visible on screen, so there are no previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • src/jobs/repeatedNoticeComment.ts (+44/−15)
  • Low risk (3 files)
    • test/issueStartNotice.test.ts (+2/−2)
    • test/processMergeConflictJob.test.ts (+2/−2)
    • test/repeatedNoticeComment.test.ts (+42/−3)

Diff size: 4 files changed, +90/−22 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 6m 16s
  • Tokens: 1,117,457 (1,105,938 in / 11,519 out)
  • Cost: $0.74

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…d added a regression test for each. Both new tests fail against the previous version of the helper and pass now.

I fixed F4 and F5 in `src/jobs/repeatedNoticeComment.ts` and added a regression test for each. Both new tests fail against the previous version of the helper and pass now.

**F4: ownership check.** `findRepeatedNotice` used to accept any comment whose author was a bot account. It now accepts only comments posted by ProPR's own bot account. That account comes from the new `proprBotUsernames()`, which reads it the same way `scanCiFailureComments` does: the detected bot name, then `GITHUB_BOT_USERNAME`, then `propr-dev[bot]`. Another app's comment that quotes the hidden marker is now skipped, so the earlier ProPR notice is the one that gets updated.
- Many test suites replace `@propr/core` with a stand-in that doesn't include the function that returns the bot name. The helper looks that function up through the whole module, so those suites still load and fall back to the configured and default names.
- All three places that publish these notices go through this one function (`errorHandlers.ts`, `issueJob/worktree.ts`, `processMergeConflictJob.ts`). No other code in this PR chooses comments by bot type, so there was nowhere else to fix.

**F5: comments past the 1,000 cap.** The 10-page limit is gone, and the helper now reads the whole thread, so a notice posted after the first 1,000 comments is found again on the next repeat. When a notice has a time window, the read passes GitHub's `since` filter, so only comments changed inside that window are fetched. The existing time check still runs as well.

**Tests** (in `test/repeatedNoticeComment.test.ts`):
- The fake thread now splits comments into pages of 100 and honours `since`.
- The F4 test has a ProPR notice followed by another bot's comment quoting it. The ProPR notice is updated to a count of 2 and the other comment is left alone.
- The F5 test has 1,050 earlier comments. Three identical reports leave one notice with a count of 3, both with and without a time window.
- The fake GitHub comments in `test/issueStartNotice.test.ts` and `test/processMergeConflictJob.test.ts` now carry a `propr-dev[bot]` login, since the check now goes by account name.

**Checks:** the typecheck passes and lint passes with zero warnings. I split `findRepeatedNotice` into small helpers to get under the lint complexity limit. The six related suites pass: repeatedNoticeComment 13/13, issueStartNotice, processMergeConflictJob, issueUsageLimitRetry, taskSubmissionLifecycle and prContinuation. I ran the last three before the final helper split, which only moved code around.

Reading the whole thread means a notice on a very long thread costs one request per 100 comments when no time window is set. Two identical notices arriving at the same moment can still both post, as before. That race comes from GitHub's API and isn't something this change can close.

Nothing here is visible on screen, so there are no previews.

PR: #3712
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements shared notice grouping across all four intended paths and improves reset-time parsing. It needs a localized correction before merge: dated resets can resolve to the wrong year near New Year in time zones behind UTC.

✅ Scoped notice grouping — Start notices preserve task identity, while merge-failure notices distinguish the live head and failure text.

✅ Useful regression coverage — Tests cover pagination beyond 1,000 comments, author filtering, read/edit failures, and repeated notices. The supplied current-head status reports 17 passed checks and no failures or pending checks.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F6: 🔴 Resolve dated resets using the local year

  • Category: correctness

  • Required behavior: A dated reset in a named time zone must produce the correct retry instant, including when its local calendar year differs from UTC.

  • Evidence: packages/core/src/utils/scheduling.ts, resetClauseTimestamp — the dated branch initializes the year using now.getUTCFullYear().

    1. At 2027-01-01T00:00:00Z, a usage-limit message reports resets Dec 31, 11pm (America/New_York). Locally it is still December 31, 2026; the reset is four hours away.
    2. The parser constructs December 31, 2027, at 11pm in New York, yielding 2028-01-01T04:00:00Z.
    3. Its rollover check only adjusts timestamps in the past, so this incorrect future timestamp remains unchanged.
    4. handleRateLimitError accepts the non-null timestamp, and handleUsageLimitError uses it to enqueue the retry approximately a year away instead of four hours away.

    static trace: Verified through the supplied parser, Claude error producer, and retry-delay calculation. The local-date conversion already present applies only to undated resets. The added rollover test covers January from November, not a local December date while UTC is already in January.

  • Minimum fix: Derive the initial calendar year from the current date in the reset’s time zone before applying rollover logic. Add a regression asserting that the example above returns 2027-01-01T04:00:00Z.

Suggestions

These are optional follow-ups and are not sent to /fix.

S3: 🟢 Share reset-clause recognition

RESET_CLAUSE_TEXT in src/jobs/errorHandlers.ts duplicates the grammar of RESET_CLAUSE in packages/core/src/utils/scheduling.ts. They currently agree, so this is not a blocker, but sharing clause recognition would help prevent future parser updates from leaving notice fingerprints inconsistent.

S4: 🟢 Exercise failed comment deletion

The helper implements a useful fallback that rewrites an attempt’s starting comment when deletion fails. A focused test covering successful earlier-report updates followed by DELETE failure would protect this cleanup behavior. This is optional coverage; the supplied code already implements the fallback.

Score

The implementation is focused and has substantial regression coverage with passing current-head checks. The demonstrated scheduling error requires a small correction before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 47s
  • Tokens: 66,306 (65,312 in / 994 out)
  • Cost: $0.59

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F6 S3 S4

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 3a2e922

Addressed 1 AI review comment (IDs: 6984318624)

Addressed finding F6

Summary of Changes

I fixed F6. A dated reset in a named time zone now takes its year from the current date in that zone, not from UTC, so the retry lands at the right instant around New Year.

Change (packages/core/src/utils/scheduling.ts, resetClauseTimestamp): the code first works out the current local date in the reset's zone. Dated resets now take their starting year from that date, and the next-year rollover adds one to that same year. Undated resets already used this local date and behave as before. Unknown zones still fall back to UTC.

Regression test (test/scheduling.test.ts): the new test covers the reported case: at 2027-01-01T00:00:00Z, resets Dec 31, 11pm (America/New_York) now returns 2027-01-01T04:00:00Z. It also checks the opposite case, a zone ahead of UTC: at 2026-12-31T16:00Z, resets Jan 1, 5am (Asia/Tokyo) returns 2026-12-31T20:00Z. The old code already got that one right through its rollover rule. I ran the new test against the previous version of the file and it fails there.

Other places with the same assumption: the dated branch was the only code that read the UTC year. The undated branch already used the local date. handleUsageLimitError and formatRetryTime only use the timestamp the parser returns, so they need no change.

Verification:

  • test/scheduling.test.ts: 22 tests pass.
  • test/repeatedNoticeComment.test.ts and test/issueUsageLimitRetry.test.ts: 29 tests pass.
  • Typecheck of packages/core (tsc --noEmit) and ESLint with --max-warnings 0 on the changed file are clean.

I found nothing else outside F6. Nothing here is visual, so there are no previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/core/src/utils/scheduling.ts (+6/−5)
  • Low risk (1 file)
    • test/scheduling.test.ts (+15/−0)

Diff size: 2 files changed, +21/−5 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 4m 53s
  • Tokens: 453,934 (450,319 in / 3,615 out)
  • Cost: $0.36

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…s year from the current date in that zone, not from UTC, so the retry lands at the right instant around New Year.

I fixed F6. A dated reset in a named time zone now takes its year from the current date in that zone, not from UTC, so the retry lands at the right instant around New Year.

**Change (`packages/core/src/utils/scheduling.ts`, `resetClauseTimestamp`):** the code first works out the current local date in the reset's zone. Dated resets now take their starting year from that date, and the next-year rollover adds one to that same year. Undated resets already used this local date and behave as before. Unknown zones still fall back to UTC.

**Regression test (`test/scheduling.test.ts`):** the new test covers the reported case: at `2027-01-01T00:00:00Z`, `resets Dec 31, 11pm (America/New_York)` now returns `2027-01-01T04:00:00Z`. It also checks the opposite case, a zone ahead of UTC: at `2026-12-31T16:00Z`, `resets Jan 1, 5am (Asia/Tokyo)` returns `2026-12-31T20:00Z`. The old code already got that one right through its rollover rule. I ran the new test against the previous version of the file and it fails there.

**Other places with the same assumption:** the dated branch was the only code that read the UTC year. The undated branch already used the local date. `handleUsageLimitError` and `formatRetryTime` only use the timestamp the parser returns, so they need no change.

**Verification:**
- `test/scheduling.test.ts`: 22 tests pass.
- `test/repeatedNoticeComment.test.ts` and `test/issueUsageLimitRetry.test.ts`: 29 tests pass.
- Typecheck of `packages/core` (`tsc --noEmit`) and ESLint with `--max-warnings 0` on the changed file are clean.

I found nothing else outside F6. Nothing here is visual, so there are no previews.

PR: #3712
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Ultrafix stopped before reaching its goal. Requested goal: 8/10. Last score: 6/10. Stopped in cycle 3 of 3. Max cycles were exhausted, so manual review and merge are now required.

@propr-dev propr-dev Bot removed the ultrafix label Nov 18, 2026
@propr-dev propr-dev Bot changed the title 🔨 [3689 by Claude Opus 5.5] Repeated and contradictory bot comments: rate limit, cancelled, started, failed ⚠️❻ [3689 by Claude Opus 5.5] Repeated and contradictory bot comments: rate limit, cancelled, started, failed Nov 18, 2026

integry commented Nov 18, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev propr-dev Bot changed the title ⚠️❻ [3689 by Claude Opus 5.5] Repeated and contradictory bot comments: rate limit, cancelled, started, failed 🔨 [3689 by Claude Opus 5.5] Repeated and contradictory bot comments: rate limit, cancelled, started, failed Nov 18, 2026
@propr-dev

propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

Ready to merge within the reviewed scope. The shared notice helper consistently handles the four targeted notices, and the scheduling changes address dated resets and local calendar boundaries.

✅ Scoped deduplication — Start notices retain task identity; merge-failure notices use the resolved head SHA. Comment matching checks ProPR’s login before editing.

✅ Useful regression coverage — Tests exercise pagination beyond 1,000 comments, changed reset times, separate task/head identities, and read/edit fallback behavior.

The authoritative checks report 17 passed, 25 skipped, and no failures or pending checks. This review used the supplied diff and context; no commands were run.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S5: 🟢 Test cleanup failure paths

Add focused coverage for deleteOwnComment in src/jobs/repeatedNoticeComment.ts: deletion fails but rewriting succeeds, and both operations fail. The implementation provides these recovery paths, but the added tests exercise only successful deletion. This is optional coverage for best-effort behavior.

S6: 🟢 Clarify repeated start wording

Consider displaying “Attempt 3; last started at…” for repeated start notices instead of “Reported 3 times.” The existing wording correctly communicates repetition, so this is an optional presentation improvement.

Score

The implementation addresses the stated scope with substantial regression coverage and passing current-head checks. Static tracing identified no verified merge blocker; the remaining suggestions are optional refinements.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 28s
  • Tokens: 67,292 (66,628 in / 664 out)
  • Cost: $0.59

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S5 S6

🤖 Review by ProPR

@propr-dev propr-dev Bot changed the title 🔨 [3689 by Claude Opus 5.5] Repeated and contradictory bot comments: rate limit, cancelled, started, failed ✅❽ [3689 by Claude Opus 5.5] Repeated and contradictory bot comments: rate limit, cancelled, started, failed Nov 18, 2026
@integry
integry merged commit ac679d5 into 3686-epic-0-9-g6i Nov 18, 2026
42 checks passed
@propr-dev propr-dev Bot changed the title ✅❽ [3689 by Claude Opus 5.5] Repeated and contradictory bot comments: rate limit, cancelled, started, failed [3689 by Claude Opus 5.5] Repeated and contradictory bot comments: rate limit, cancelled, started, failed Nov 18, 2026
propr-dev Bot pushed a commit that referenced this pull request Nov 18, 2026
… call, and skip any label the PR already has. But I couldn't find a second labelling call in ProPR's code for the normal case, so this may not stop the duplicates you're seeing.

What the PR timelines show. I checked the last 80 PRs and 23 have `AI` added twice, in two patterns:
- Older PRs (#3579–#3711): `AI` and `llm-*` appear twice, 0–1 s apart. ProPR's retry waits at least 2 s, so a retry can't explain this.
- Newer PRs (#3712, #3717): `AI`, `ultrafix` and `llm-*` all appear again 2 s after `ultrafix` is added. No ProPR code adds those three together, and `ultrafix` was already on the PR.

Normal creation makes a single label call. The labels were already in place when the second set appeared. That suggests GitHub may record labels again on a PR it is still setting up, which ProPR can't prevent. I couldn't test that without making real PRs.

Code paths that could label twice, now fixed:
- Final validation: if a step after creation failed, the run lost track of the PR it had opened. Final validation then found that PR and labelled it again. Validation now records the labels the PR already has (`packages/core/src/utils/prValidation.ts`), so that second call sends nothing.
- Creation itself: in `src/jobs/issueJobHelpers.ts`, only the create request is now inside the `try`. Labelling happens once afterwards, so an error after labelling can no longer fall into the "find existing PR" path and label again.
- The other paths (existing PR found after a duplicate error, and the API retry in `src/jobs/issueJobPRRetry.ts`) use the same shared helper and skip labels GitHub already lists on the PR.
- The shared helper in `src/jobs/pullRequestProcessingLabels.ts` now sends only the missing labels, and makes no call at all when nothing is missing.

Tests
- A new file, `test/pullRequestCreationLabels.test.ts`, checks that each creation path makes exactly one label call. It also checks that labels already on the PR aren't re-sent, and that a failed label call isn't repeated through the existing-PR fallback.
- I added cases to `test/recoveredPullRequestLabels.test.ts` covering final validation and the API retry when the PR already has some or all of its labels.
- Against the original `issueJobHelpers.ts`, 2 of the 5 new creation-path tests fail. The single-call tests also pass on the old code, because it already made one call per path.
- The suites that touch these files ran 508 tests with 507 passing and 0 failing. Typecheck is clean for the root and core packages, and lint is clean on the changed source files.

If the duplicates continue after this ships, the next step is to compare ProPR's worker log for one affected PR with its timeline. Two "Added processing labels" log lines would mean ProPR sent two calls; one would mean the duplicate comes from GitHub.

The change isn't visible on screen, so there are no previews.
integry pushed a commit that referenced this pull request Nov 18, 2026
…hen a PR is created (#3721)

What the PR timelines show. I checked the last 80 PRs and 23 have `AI` added twice, in two patterns:
- Older PRs (#3579–#3711): `AI` and `llm-*` appear twice, 0–1 s apart. ProPR's retry waits at least 2 s, so a retry can't explain this.
- Newer PRs (#3712, #3717): `AI`, `ultrafix` and `llm-*` all appear again 2 s after `ultrafix` is added. No ProPR code adds those three together, and `ultrafix` was already on the PR.

Normal creation makes a single label call. The labels were already in place when the second set appeared. That suggests GitHub may record labels again on a PR it is still setting up, which ProPR can't prevent. I couldn't test that without making real PRs.

Code paths that could label twice, now fixed:
- Final validation: if a step after creation failed, the run lost track of the PR it had opened. Final validation then found that PR and labelled it again. Validation now records the labels the PR already has (`packages/core/src/utils/prValidation.ts`), so that second call sends nothing.
- Creation itself: in `src/jobs/issueJobHelpers.ts`, only the create request is now inside the `try`. Labelling happens once afterwards, so an error after labelling can no longer fall into the "find existing PR" path and label again.
- The other paths (existing PR found after a duplicate error, and the API retry in `src/jobs/issueJobPRRetry.ts`) use the same shared helper and skip labels GitHub already lists on the PR.
- The shared helper in `src/jobs/pullRequestProcessingLabels.ts` now sends only the missing labels, and makes no call at all when nothing is missing.

Tests
- A new file, `test/pullRequestCreationLabels.test.ts`, checks that each creation path makes exactly one label call. It also checks that labels already on the PR aren't re-sent, and that a failed label call isn't repeated through the existing-PR fallback.
- I added cases to `test/recoveredPullRequestLabels.test.ts` covering final validation and the API retry when the PR already has some or all of its labels.
- Against the original `issueJobHelpers.ts`, 2 of the 5 new creation-path tests fail. The single-call tests also pass on the old code, because it already made one call per path.
- The suites that touch these files ran 508 tests with 507 passing and 0 failing. Typecheck is clean for the root and core packages, and lint is clean on the changed source files.

If the duplicates continue after this ships, the next step is to compare ProPR's worker log for one affected PR with its timeline. Two "Added processing labels" log lines would mean ProPR sent two calls; one would mean the duplicate comes from GitHub.

The change isn't visible on screen, so there are no previews.

Co-authored-by: propr-dev[bot] <1316198+propr-dev[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant