Skip to content

fix(seer): Preserve recommended sort order for unscored issues in night shift#115444

Open
trevor-e wants to merge 5 commits into
masterfrom
telkins/night-shift-preserve-recommended-sort
Open

fix(seer): Preserve recommended sort order for unscored issues in night shift#115444
trevor-e wants to merge 5 commits into
masterfrom
telkins/night-shift-preserve-recommended-sort

Conversation

@trevor-e
Copy link
Copy Markdown
Member

Summary

  • Night shift's fixability_score_strategy previously re-ranked all candidates by a weighted fixability score, which collapsed unscored issues (null fixability) to 0.0 — effectively disrupting the recommended sort order from Snuba for issues that hadn't been scored yet.
  • Now candidates are partitioned into three buckets:
    1. Scored above threshold (>= MEDIUM / 0.40) — sorted by fixability, taken first
    2. Unscored (null) — preserves original recommended sort order as backfill
    3. Scored below threshold — dropped entirely (already evaluated, not actionable)

Test plan

  • Updated TestFixabilityScoreStrategy to verify scored issues come first, unscored preserve order, and below-threshold issues are excluded
  • All pre-commit hooks pass

…ht shift

Previously, all candidates were re-ranked by a weighted fixability score,
which collapsed unscored issues (null fixability) to 0.0 and disrupted
the recommended sort order from Snuba. Now candidates are split into
three buckets:

1. Scored above threshold (>= MEDIUM) — sorted by fixability, taken first
2. Unscored (null) — preserves original recommended sort order as backfill
3. Scored below threshold — dropped entirely (already evaluated, not actionable)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 12, 2026
The test_selects_candidates_and_skips_triggered test used a fixability
score of 0.2, which now falls below the MEDIUM threshold and gets
excluded. Bump to 0.5 so the test still exercises two-candidate
selection.

Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread src/sentry/tasks/seer/night_shift/simple_triage.py
The severity field was only consumed by the score property removed in
the prior commit. times_seen is kept since it's still used in triage
logging.

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 715ad2c. Configure here.

Comment thread src/sentry/tasks/seer/night_shift/simple_triage.py Outdated
trevor-e and others added 2 commits May 12, 2026 18:51
Unscored issues (null fixability) were being presented to the triage
agent as fixability=0.00, which the prompt describes as "not fixable".
Now fixability is None for unscored issues, rendered as "not scored"
in the triage prompt, and the prompt instructs the agent to treat
them neutrally.

Co-Authored-By: Claude <noreply@anthropic.com>
The previous commit skipped the metric entirely when fixability was
None. Restore the original unknown-group-id guard and only omit the
threshold_action attribute when the score is missing.

Co-Authored-By: Claude <noreply@anthropic.com>
@trevor-e trevor-e marked this pull request as ready for review May 12, 2026 23:43
@trevor-e trevor-e requested a review from a team as a code owner May 12, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant