Skip to content

claim bot: an older Decided: is taken as the answer to a newer Decision needed:, labels flap #22

Closed

Description

@vpacher

What

The claim bot (workflow/claims.py) reads the decision state of an issue wrongly when a thread has more than one decision round. Two instances in obs-rust/obs-studio on 2026-10-30:

1. obs-rust/obs-studio#3031: an older Decided: taken as the answer to a newer Decision needed:, labels flapping.

Time (UTC) Event
09:12 maintainer comment Decided: option 1 ... (never edited)
09:48 claimant comment **Decision needed:** how to fix it under that test ...; bot adds decision-needed and claim-blocked
10:12:24 scheduled Claim bot run
10:14:25, 10:14:27 bot removes decision-needed and claim-blocked, and comments "the decision is in; your claim is no longer blocked", quoting the 09:12 Decided:
10:14:32, 10:14:34 bot adds decision-needed and claim-blocked again
10:17:59 after a plain comment by the claimant (no Blocked:, no Decision needed:), bot removes claim-blocked; decision-needed stays

So the 09:58 question is still open (no Decided: after it), but the thread has a "decision is in" message, and the claim is no longer blocked.

2. obs-rust/obs-studio#2593, 03:24: the bot rejected a claim with "it waits on an open decision (decision-needed)", although the maintainer had answered with Decided: on 2026-10-27 and, per the maintainer's comment at 03:49, the label was not on the issue. This fits the same flapping: a sweep sets the label again from an older Decision needed:.

Probable cause

decided() acts on a Decided: comment without checking whether a Decision needed: came after it; a scheduled sweep that walks the comments can then clear the labels on the old Decided: and set them again on the newer question. The order of the two comment kinds is what decides whether a decision is open: a decision is open if the newest Decision needed: is newer than the newest maintainer Decided:/Decision:.

Second effect: blocked_since() treats any later comment of the claimant that is not Blocked:/Decision needed: as progress, so a clarification about the open question (10:17 above) unblocks the claim. Progress while a decision is open may be better read from PR activity only, or the open decision itself kept as the block.

Proposed fix

  • Derive "decision open" from the order: newest Decision needed: against newest maintainer Decided:/Decision:; set or clear decision-needed and claim-blocked from that, the same way on events and in the sweep.
  • Post "the decision is in" only for a Decided: that is newer than the open question.
  • Keep claim-blocked while decision-needed is set (or do not count claimant comments as progress then).
  • A test with the #3031 sequence: Decided, then Decision needed, then a sweep must leave both labels set and post nothing.

Activity

  1. zackees commented on Oct 30, 2026

    @zackees
    Member

    /ready

    Triage: meets Ready. It has a reproduction (two timed instances, #3031 and #2593), a probable cause in workflow/claims.py (decided() ignores comment order, and blocked_since() counts any claimant comment as progress), a proposed fix, and a failing-test sketch (the #3031 sequence: Decided, then Decision needed, then a sweep must leave both labels and post nothing). P1: it unblocks claims on open decisions and posts misleading "the decision is in" messages across every org repo. size:S.

  2. added
    bug
    P1
    size:S
    ready
    on Oct 30, 2026
  3. zackees commented on Oct 30, 2026

    @zackees
    Member

    Claiming: #22 — an older Decided: must not answer a newer Decision needed:.

    1. RED: tests/test_claims.py cases for the #3031 sequence — Decided: at 09:12, Decision needed: at 09:48 — asserting that replaying the older answer leaves decision-needed and claim-blocked set and posts nothing, plus the sweep cases (an open question re-adds a lost label; an answered one clears it; a bare label with no decision comments is left alone).
    2. GREEN: derive the decision state from comment order (workflow/claims.py): decided() acts only when no question is newer than the answer; missed() does not replay a superseded answer; decide_sweep() re-adds decision-needed for an open question and clears it only when an answer newer than the newest question is in the history.
    3. Keep #2057's pinned behaviour (a claimant's plain progress comment clears claim-blocked but keeps decision-needed) and say so in the PR, so the change does not silently revisit it.
    4. One PR against master, RED then GREEN, ./lint clean, Fixes #22.
  4. self-assigned this
    on Oct 30, 2026
  5. zackees commented on Oct 30, 2026

    @zackees
    Member

    Fixed by #23 (merged 25bbcb9), and checked against this thread's real comments rather than only the fixtures.

    workflow/claims.py now derives the decision state from the order of the two comment kinds (decision_state() → open / answered / unknown):

    • decided() changes nothing when a Decision needed: is newer than the answer — it only reacts, so no label removal and no "the decision is in".
    • missed()/catch_up() no longer replay a superseded answer, which is what produced steps 3 and 4 here.
    • decide_sweep() repairs decision-needed from the history: adds it for an open question, clears it once an answer newer than the newest question exists (with claim-blocked when the question was the block). An escalated issue and a thread with no decision comments are left alone, so a hand-set label is never cleared on a guess.

    Checked with the live comment list of this issue, 2026-10-30:

    Moment decision_state()
    after the 09:12 Decided: answered
    after the 09:48 question open
    after the 11:23 Decided: answered

    And at the sweep's 10:14 replay, missed() returns the 09:05 and 09:48 questions and the claim comment, no longer the 09:12 answer; calling decide_comment() on that answer directly returns [("react", …)] alone.

    The #2057 rule you pinned — a claimant's plain progress comment clears claim-blocked and keeps decision-needed — is unchanged, and its test still holds it, so whether progress should count while a decision is open (the 10:17 effect) is still an open call for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1bugreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions