Skip to content

feat(issue-search): per-request weight override for recommended_v2 sort#118365

Draft
roggenkemper wants to merge 1 commit into
masterfrom
roggenkemper/recommended-v2-staff-weight-override
Draft

feat(issue-search): per-request weight override for recommended_v2 sort#118365
roggenkemper wants to merge 1 commit into
masterfrom
roggenkemper/recommended-v2-staff-weight-override

Conversation

@roggenkemper

@roggenkemper roggenkemper commented Jun 24, 2026

Copy link
Copy Markdown
Member

Allow passing in alternate recommended_v2 weights against the live default side by side.

How it works

GET ...?sort=recommended_v2&recommendedWeights={"event_volume":0.05,"spike":0,"severity":0.3,"assignment":0.3}

The weights override the registered options for that request only:

  • Base factors (recency/spike/severity/event-volume/user_impact/message_penalty/group_type_boost) flow into the Snuba aggregation via the existing aggregate_kwargs channel (recommended_aggregation already received it; it just ignored it).
  • Boost weights (assignment/fixability/agent/regressed/newness) rebuild the recommended_v2 score_fn for the request.
  • Any weight you don't pass falls back to options, so a normal request is unchanged.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 24, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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 2 potential issues.

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 7e003a5. Configure here.

Comment thread src/sentry/api/helpers/group_index/index.py
Comment thread src/sentry/api/helpers/group_index/index.py Outdated
Comment thread src/sentry/api/helpers/group_index/index.py Outdated
@roggenkemper roggenkemper force-pushed the roggenkemper/recommended-v2-staff-weight-override branch 2 times, most recently from b046862 to 0cee70b Compare June 24, 2026 17:17
@roggenkemper roggenkemper changed the title feat(issue-search): staff weight override for recommended_v2 sort feat(issue-search): per-request weight override for recommended_v2 sort Jun 24, 2026
Compare alternate recommended_v2 weights against the live default in a single
request via ?recommendedWeights={...}, without touching options or adding a
second sort. The weights override the registered options for that request only
and rerank just the requester's own feed: base factors flow into the Snuba
aggregation through the existing aggregate_kwargs channel, boost weights rebuild
the score_fn, and any unspecified weight falls back to options.

Gated to the recommended_v2 sort since aggregate_kwargs is shared with trends.
Payload is sanitized before it reaches the ClickHouse scoring SQL: weights and
boost values must be finite floats, and group-type-boost keys are coerced to ints.

Co-Authored-By: Claude <noreply@anthropic.com>
@roggenkemper roggenkemper force-pushed the roggenkemper/recommended-v2-staff-weight-override branch from 2ab3f51 to 0794a5f Compare June 24, 2026 17:48
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