-
-
Couldn't load subscription status.
- Fork 4.5k
fix(ai-insights): remove sampling mode from query #102068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| limit=limit, | ||
| referrer=Referrer.API_AI_CONVERSATIONS.value, | ||
| config=SearchResolverConfig(auto_fields=True), | ||
| sampling_mode="HIGHEST_ACCURACY", | ||
| sampling_mode=None, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: First query uses sampling_mode=None instead of HIGHEST_ACCURACY for AI conversation ID discovery.
Severity: CRITICAL | Confidence: 1.00
🔍 Detailed Analysis
The initial query for discovering AI conversation IDs uses sampling_mode=None. This violates explicit repository requirements stating that AI conversation data queries must use sampling_mode="HIGHEST_ACCURACY" to ensure complete and non-extrapolated results. This leads to silently returning incomplete conversation data.
💡 Suggested Fix
Change sampling_mode=None to sampling_mode="HIGHEST_ACCURACY" for the initial conversation ID discovery query to comply with data completeness requirements.
🤖 Prompt for AI Agent
Fix this bug. In src/sentry/api/endpoints/organization_ai_conversations.py at lines
126-130: The initial query for discovering AI conversation IDs uses
`sampling_mode=None`. This violates explicit repository requirements stating that AI
conversation data queries must use `sampling_mode="HIGHEST_ACCURACY"` to ensure complete
and non-extrapolated results. This leads to silently returning incomplete conversation
data.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial query for discovering AI conversation IDs uses sampling_mode=None. This violates explicit repository requirements stating that AI conversation data queries must use sampling_mode="HIGHEST_ACCURACY" to ensure complete and non-extrapolated results. This leads to silently returning incomplete conversation data.
While it is true that with sampling_mode=None some results might be sampled out, the "repository requirements" seem to be completely hallucinated
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| from sentry.search.eap.types import SearchResolverConfig | ||
| from sentry.snuba.referrer import Referrer | ||
| from sentry.snuba.spans_rpc import Spans | ||
| from sentry.utils import json, logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be imported from python std lib, right?
| logger.info( | ||
| "[ai-conversations] Collecting traces and flows", | ||
| extra={"all_spans_results": json.dumps(all_spans_results)}, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes: SENTRY-5BD5