Skip to content

Commit 1df9d6d

Browse files
cursoragentarmenzg
andcommitted
fix(seer): Add gen-ai-explore-metrics-search flag check to state endpoint
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>
1 parent 80e14c4 commit 1df9d6d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/sentry/seer/endpoints/search_agent_state.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,12 @@ def get(self, request: Request, organization: Organization, run_id: str) -> Resp
8181
}
8282
}
8383
"""
84-
if not features.has(
84+
has_feature = features.has(
8585
"organizations:gen-ai-search-agent-translate", organization, actor=request.user
86-
):
86+
) or features.has(
87+
"organizations:gen-ai-explore-metrics-search", organization, actor=request.user
88+
)
89+
if not has_feature:
8790
return Response(
8891
{"detail": "Feature flag not enabled"},
8992
status=status.HTTP_403_FORBIDDEN,

0 commit comments

Comments
 (0)