Skip to content

Commit b463c47

Browse files
roggenkemperclaude
andcommitted
fix(issue-detection): Check ai_issue_detection_enabled before running detection
Respect the user's project-level setting to avoid wasting Snuba queries and Seer calls when AI detection is disabled for the selected project. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b12c4d1 commit b463c47

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sentry/tasks/llm_issue_detection/detection.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,12 @@ def detect_llm_issues_for_org(org_id: int) -> None:
365365
return
366366

367367
project_id = random.choice(projects)
368+
369+
project = Project.objects.get_from_cache(id=project_id)
370+
perf_settings = project.get_option("sentry:performance_issue_settings", default={})
371+
if not perf_settings.get("ai_issue_detection_enabled", True):
372+
return
373+
368374
evidence_traces = get_project_top_transaction_traces_for_llm_detection(
369375
project_id, limit=TRANSACTION_BATCH_SIZE, start_time_delta_minutes=START_TIME_DELTA_MINUTES
370376
)

0 commit comments

Comments
 (0)