feat(assisted-query): Add metrics search feature flag and forward options#112240
Open
isaacwang-sentry wants to merge 2 commits intomasterfrom
Open
feat(assisted-query): Add metrics search feature flag and forward options#112240isaacwang-sentry wants to merge 2 commits intomasterfrom
isaacwang-sentry wants to merge 2 commits intomasterfrom
Conversation
…ions Register gen-ai-explore-metrics-search feature flag to gate the metrics AI search bar independently from the shared gen-ai-search-agent-translate flag. Forward the full options dict to Seer instead of extracting only model_name, so strategy-specific context like metric_context can pass through. 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: State endpoint missing new metrics feature flag check
- Added gen-ai-explore-metrics-search flag check to state endpoint to match the start endpoint's feature flag logic, allowing users with only the metrics flag to poll for search agent state.
Or push these changes by commenting:
@cursor push 1df9d6d530
Preview (1df9d6d530)
diff --git a/src/sentry/seer/endpoints/search_agent_state.py b/src/sentry/seer/endpoints/search_agent_state.py
--- a/src/sentry/seer/endpoints/search_agent_state.py
+++ b/src/sentry/seer/endpoints/search_agent_state.py
@@ -81,9 +81,12 @@
}
}
"""
- if not features.has(
+ has_feature = features.has(
"organizations:gen-ai-search-agent-translate", organization, actor=request.user
- ):
+ ) or features.has(
+ "organizations:gen-ai-explore-metrics-search", organization, actor=request.user
+ )
+ if not has_feature:
return Response(
{"detail": "Feature flag not enabled"},
status=status.HTTP_403_FORBIDDEN,This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 80e14c4. Configure here.
…oint The start endpoint allows access with either gen-ai-search-agent-translate or gen-ai-explore-metrics-search flag when strategy is Metrics, but the state endpoint only checked gen-ai-search-agent-translate. This caused users with only the metrics flag to successfully start a search agent but get 403 errors when polling for state. Since the state endpoint doesn't know which strategy was used, it now accepts either flag to match the start endpoint's behavior. Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com> Applied via @cursor push command
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.


Summary
gen-ai-explore-metrics-searchfeature flag to gate the metrics AI search bar independentlySearchAgentStartEndpointto accept the new flag when strategy is "Metrics"optionsdict to Seer instead of extracting onlymodel_name, so strategy-specific context (likemetric_context) passes throughTest plan
gen-ai-explore-metrics-searchflag is registered and exposed to the frontendstrategy: "Metrics"when the new flag is enabledoptionsdict is forwarded to Seer