diff --git a/src/sentry/seer/autofix/issue_summary.py b/src/sentry/seer/autofix/issue_summary.py index 991045bda437c1..47d62bd80b4e83 100644 --- a/src/sentry/seer/autofix/issue_summary.py +++ b/src/sentry/seer/autofix/issue_summary.py @@ -322,36 +322,17 @@ def run_automation( return # Check event count for ALERT source with triage-signals-v0-org - if source == SeerAutomationSource.ALERT and features.has( - "organizations:triage-signals-v0-org", group.organization - ): - # Use times_seen_with_pending if available (set by post_process), otherwise fall back - times_seen = ( - group.times_seen_with_pending - if hasattr(group, "_times_seen_pending") - else group.times_seen - ) - if times_seen < 10: - logger.info( - "Triage signals V0: skipping alert automation, event count < 10", - extra={ - "group_id": group.id, - "project_slug": group.project.slug, - "event_count": times_seen, - }, + if is_seer_seat_based_tier_enabled(group.organization): + if source == SeerAutomationSource.ALERT: + # Use times_seen_with_pending if available (set by post_process), otherwise fall back + times_seen = ( + group.times_seen_with_pending + if hasattr(group, "_times_seen_pending") + else group.times_seen ) - return - - # Only log for orgs with seat-based Seer tier - try: - should_log = is_seer_seat_based_tier_enabled(group.organization) - except Exception: - logger.exception( - "Error checking if seat-based Seer tier is enabled", extra={"group_id": group.id} - ) - should_log = False + if times_seen < 10: + return - if should_log: try: times_seen = group.times_seen_with_pending except (AssertionError, AttributeError): @@ -403,7 +384,7 @@ def run_automation( return stopping_point = None - if features.has("organizations:triage-signals-v0-org", group.organization): + if is_seer_seat_based_tier_enabled(group.organization): fixability_stopping_point = _get_stopping_point_from_fixability(fixability_score) # Fetch user preference and apply as upper bound diff --git a/src/sentry/seer/similarity/utils.py b/src/sentry/seer/similarity/utils.py index 49c2459fd4ad6c..27ffd0f8f61ae7 100644 --- a/src/sentry/seer/similarity/utils.py +++ b/src/sentry/seer/similarity/utils.py @@ -8,7 +8,7 @@ import sentry_sdk from tokenizers import Tokenizer -from sentry import features, options +from sentry import options from sentry.constants import DATA_ROOT from sentry.grouping.api import get_contributing_variant_and_component from sentry.grouping.grouping_info import get_grouping_info_from_variants_legacy @@ -17,6 +17,7 @@ from sentry.models.organization import Organization from sentry.models.project import Project from sentry.seer.autofix.constants import AutofixAutomationTuningSettings +from sentry.seer.autofix.utils import is_seer_seat_based_tier_enabled from sentry.services.eventstore.models import Event, GroupEvent from sentry.utils import metrics from sentry.utils.safe import get_path @@ -509,7 +510,7 @@ def set_default_project_autofix_automation_tuning( if org_default == "off": # Explicit "off" is always respected, regardless of feature flag project.update_option("sentry:autofix_automation_tuning", "off") - elif features.has("organizations:triage-signals-v0-org", organization): + elif is_seer_seat_based_tier_enabled(organization): # Feature flag ON overrides everything except explicit "off" project.update_option( "sentry:autofix_automation_tuning", @@ -524,7 +525,7 @@ def set_default_project_seer_scanner_automation( organization: Organization, project: Project ) -> None: """Called once at project creation time to set the initial seer scanner automation.""" - if features.has("organizations:triage-signals-v0-org", organization): + if is_seer_seat_based_tier_enabled(organization): # Feature flag ON always sets scanner to True project.update_option("sentry:seer_scanner_automation", True) else: diff --git a/src/sentry/tasks/post_process.py b/src/sentry/tasks/post_process.py index 95ad76dfd66e5a..a77ad1bd218678 100644 --- a/src/sentry/tasks/post_process.py +++ b/src/sentry/tasks/post_process.py @@ -1608,6 +1608,7 @@ def kick_off_seer_automation(job: PostProcessJob) -> None: from sentry.seer.autofix.utils import ( is_issue_eligible_for_seer_automation, is_seer_scanner_rate_limited, + is_seer_seat_based_tier_enabled, ) from sentry.tasks.autofix import ( generate_issue_summary_only, @@ -1619,7 +1620,7 @@ def kick_off_seer_automation(job: PostProcessJob) -> None: group = event.group # Default behaviour - if not features.has("organizations:triage-signals-v0-org", group.organization): + if not is_seer_seat_based_tier_enabled(group.organization): # Only run on issues with no existing scan if group.seer_fixability_score is not None: return