feat(seer): Use Seer model_used response field for seer_model on GroupHashMetadata#111047
Merged
feat(seer): Use Seer model_used response field for seer_model on GroupHashMetadata#111047
Conversation
…pHashMetadata Record the model Seer actually used (from its response) separately from the model we requested. This gives visibility into Seer-side fallbacks (e.g. v2 requested but v1 used). - Add model_used to SimilarIssuesEmbeddingsResponse type - Return (results, model_used) tuple from get_similarity_data_from_seer - Thread model_used through get_seer_similar_issues as 3rd return element - Set seer_model from response (with fallback to requested version) - Set seer_latest_training_model from what was requested Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed:
model_useddiscarded when Seer returns empty results- Changed return value from ([], None) to ([], model_used) at line 188 to preserve the model version when Seer returns no matches.
Or push these changes by commenting:
@cursor push 47bcd7300d
Preview (47bcd7300d)
diff --git a/src/sentry/seer/similarity/similar_issues.py b/src/sentry/seer/similarity/similar_issues.py
--- a/src/sentry/seer/similarity/similar_issues.py
+++ b/src/sentry/seer/similarity/similar_issues.py
@@ -185,7 +185,7 @@
sample_rate=options.get("seer.similarity.metrics_sample_rate"),
tags={**metric_tags, "outcome": "no_similar_groups"},
)
- return ([], None)
+ return ([], model_used)
# This may get overwritten as we process the results, but by this point we know that Seer at
# least found *something*This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Contributor
Backend Test FailuresFailures on
|
- Fix deletion tests that still mocked get_seer_similar_issues with 2-tuples instead of 3-tuples - Return model_used (instead of None) when Seer returns empty results, so fallback detection works even with no matches Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
kddubey
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Use Seer's
model_usedresponse field to record what model Seer actually used, separately from what we requested.When Sentry calls Seer for similarity grouping,
GroupHashMetadata.seer_modelwas previously set from what Sentry requested. If Seer internally falls back from v2 to v1, we had no visibility into that. Seer now returns amodel_usedfield in the response — this PR consumes it.seer_model← what Seer actually used (model_usedfrom response, falling back to the requested version)seer_latest_training_model← what we sent (always the requested version)Changes:
model_used: NotRequired[str]toSimilarIssuesEmbeddingsResponseget_similarity_data_from_seernow returnstuple[list[SeerSimilarIssueData], str | None]get_seer_similar_issuesnow returns a 3-tuple threadingmodel_usedthroughmaybe_check_seer_for_matching_grouphashsetsseer_modelfrom the response valueBackward compatible:
model_usedis parsed with.get()defaulting toNone, andseer_model_used or model_version.valuemeans behavior is identical to today if the field is absent. No migration needed.