Skip to content

feat(issues): Add project-level enable option for LLM issue detection#112710

Merged
roggenkemper merged 10 commits intomasterfrom
roggenkemper/feat/llm-detection-enable-option
Apr 15, 2026
Merged

feat(issues): Add project-level enable option for LLM issue detection#112710
roggenkemper merged 10 commits intomasterfrom
roggenkemper/feat/llm-detection-enable-option

Conversation

@roggenkemper
Copy link
Copy Markdown
Member

@roggenkemper roggenkemper commented Apr 10, 2026

Add ai_issue_detection_enabled to the performance issue detection settings. also adds settings for specific issue types and filtering for those issue types if the setting is off

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 10, 2026
Comment thread src/sentry/issues/endpoints/project_performance_issue_settings.py Outdated
Add `llm_issue_detection_enabled` to the performance issue detection
settings, consistent with how other detector toggles work. Defaults to
True so existing projects are unaffected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@roggenkemper roggenkemper force-pushed the roggenkemper/feat/llm-detection-enable-option branch from d7f4586 to 26e33e4 Compare April 10, 2026 19:39
Comment thread src/sentry/tasks/llm_issue_detection/detection.py Outdated
Each new AI detected group type (HTTP, DB, Runtime Performance, Security,
Code Health, General) gets its own enable/disable toggle as a sub-option
under the main llm_issue_detection_enabled setting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename the project option key, enum member, and serializer field from
llm_issue_detection_enabled to ai_issue_detection_enabled for consistency
with the new AI detected group type naming.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
roggenkemper and others added 2 commits April 15, 2026 12:42
…issues

Add GROUP_TYPE_TO_SETTING mapping and check the project's performance
issue settings for the specific group type (e.g., ai_detected_http_enabled)
before producing an issue occurrence. This allows users to disable specific
AI detection categories while keeping others enabled.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@roggenkemper
Copy link
Copy Markdown
Member Author

bugbot run

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9af4d00. Configure here.

Comment thread src/sentry/tasks/llm_issue_detection/detection.py
Comment thread src/sentry/issues/endpoints/project_performance_issue_settings.py Outdated
ai_issue_detection_enabled has no entry in project_settings_to_group_map
since it doesn't map to a single group type. Add a separate description
mapping for parent-only settings so the audit log renders a meaningful
message when the global AI detection toggle is changed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…eralGroupType for audit log

The parent toggle had no entry in project_settings_to_group_map, causing
an empty audit log message when toggled. Map it to AIDetectedGeneralGroupType
so the audit log renders a meaningful description.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…up_map

The per-group-type children (ai_detected_http_enabled, etc.) should be
treated like other children in thresholds_to_manage_map, not as
management-level settings. Issue creation blocking is handled by
GROUP_TYPE_TO_SETTING in detection.py.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only the parent toggle belongs in DEFAULT_PROJECT_PERFORMANCE_DETECTION_SETTINGS,
matching how other child thresholds get their defaults elsewhere. The children
default to True via the get() fallback in detection.py.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ttings

Matches the pattern used by other callers of this option and prevents
AttributeError if stored value is None.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@roggenkemper roggenkemper marked this pull request as ready for review April 15, 2026 19:01
@roggenkemper roggenkemper requested review from a team as code owners April 15, 2026 19:01
@roggenkemper roggenkemper removed the request for review from a team April 15, 2026 19:01
@roggenkemper roggenkemper removed the request for review from a team April 15, 2026 19:01
@roggenkemper roggenkemper merged commit 7900d40 into master Apr 15, 2026
55 checks passed
@roggenkemper roggenkemper deleted the roggenkemper/feat/llm-detection-enable-option branch April 15, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants