diff --git a/src/sentry/feedback/endpoints/organization_feedback_categories.py b/src/sentry/feedback/endpoints/organization_feedback_categories.py index 5679f018cd11ae..8e75979177a26d 100644 --- a/src/sentry/feedback/endpoints/organization_feedback_categories.py +++ b/src/sentry/feedback/endpoints/organization_feedback_categories.py @@ -32,8 +32,8 @@ logger = logging.getLogger(__name__) -SEER_TIMEOUT_S = 30 -SEER_RETRIES = Retry(total=1, backoff_factor=3) # 1 retry after a 3 second delay. +PIZZAAGENT_TIMEOUT_S = 30 +PIZZAAGENT_RETRIES = Retry(total=1, backoff_factor=3) # 1 retry after a 3 second delay. MIN_FEEDBACKS_CONTEXT = 10 @@ -193,8 +193,8 @@ def get(self, request: Request, organization: Organization) -> Response: try: response = make_label_groups_request( seer_request, - timeout=SEER_TIMEOUT_S, - retries=SEER_RETRIES, + timeout=PIZZAAGENT_TIMEOUT_S, + retries=PIZZAAGENT_RETRIES, viewer_context=viewer_context, ) except Exception: diff --git a/src/sentry/feedback/endpoints/organization_feedback_summary.py b/src/sentry/feedback/endpoints/organization_feedback_summary.py index 4f10d724582c48..8a260298de8e6b 100644 --- a/src/sentry/feedback/endpoints/organization_feedback_summary.py +++ b/src/sentry/feedback/endpoints/organization_feedback_summary.py @@ -32,8 +32,8 @@ # One day since the cache key includes the start and end dates at hour granularity SUMMARY_CACHE_TIMEOUT = 86400 -SEER_TIMEOUT_S = 30 -SEER_RETRIES = Retry(total=1, backoff_factor=3) # 1 retry after a 3 second delay. +PIZZAAGENT_TIMEOUT_S = 30 +PIZZAAGENT_RETRIES = Retry(total=1, backoff_factor=3) # 1 retry after a 3 second delay. def get_summary_from_seer( @@ -44,8 +44,8 @@ def get_summary_from_seer( try: response = make_summarize_feedbacks_request( request_body, - timeout=SEER_TIMEOUT_S, - retries=SEER_RETRIES, + timeout=PIZZAAGENT_TIMEOUT_S, + retries=PIZZAAGENT_RETRIES, viewer_context=viewer_context, ) except Exception: diff --git a/src/sentry/feedback/usecases/label_generation.py b/src/sentry/feedback/usecases/label_generation.py index 98a071bfbfeb2f..6486f7fc0d694f 100644 --- a/src/sentry/feedback/usecases/label_generation.py +++ b/src/sentry/feedback/usecases/label_generation.py @@ -13,8 +13,8 @@ # Max length of the serialized list of labels, which matches the max length of a tag value, from https://docs.sentry.io/platforms/javascript/enriching-events/tags/ MAX_AI_LABELS_JSON_LENGTH = 200 -SEER_TIMEOUT_S = 15 -SEER_RETRIES = 0 # Do not retry since this is called in ingest. +PIZZAAGENT_TIMEOUT_S = 15 +PIZZAAGENT_RETRIES = 0 # Do not retry since this is called in ingest. @metrics.wraps("feedback.generate_labels") @@ -36,8 +36,8 @@ def generate_labels( try: response = make_label_generation_request( request, - timeout=SEER_TIMEOUT_S, - retries=SEER_RETRIES, + timeout=PIZZAAGENT_TIMEOUT_S, + retries=PIZZAAGENT_RETRIES, viewer_context=viewer_context, ) except Exception: diff --git a/src/sentry/feedback/usecases/spam_detection.py b/src/sentry/feedback/usecases/spam_detection.py index a7306c4cc4b23c..65e581c44d78fa 100644 --- a/src/sentry/feedback/usecases/spam_detection.py +++ b/src/sentry/feedback/usecases/spam_detection.py @@ -9,8 +9,8 @@ logger = logging.getLogger(__name__) -SEER_TIMEOUT_S = 15 -SEER_RETRIES = 0 +PIZZAAGENT_TIMEOUT_S = 15 +PIZZAAGENT_RETRIES = 0 @metrics.wraps("feedback.spam_detection_seer") @@ -33,8 +33,8 @@ def is_spam_seer( try: response = make_spam_detection_request( seer_request, - timeout=SEER_TIMEOUT_S, - retries=SEER_RETRIES, + timeout=PIZZAAGENT_TIMEOUT_S, + retries=PIZZAAGENT_RETRIES, viewer_context=viewer_context, ) except Exception: diff --git a/src/sentry/feedback/usecases/title_generation.py b/src/sentry/feedback/usecases/title_generation.py index cae8feffc110b5..80f1ed9667edd9 100644 --- a/src/sentry/feedback/usecases/title_generation.py +++ b/src/sentry/feedback/usecases/title_generation.py @@ -11,8 +11,8 @@ logger = logging.getLogger(__name__) -SEER_TIMEOUT_S = 15 -SEER_RETRIES = 0 # Do not retry since this is called in ingest. +PIZZAAGENT_TIMEOUT_S = 15 +PIZZAAGENT_RETRIES = 0 # Do not retry since this is called in ingest. def truncate_feedback_title(title: str, max_words: int = 10) -> str: @@ -70,8 +70,8 @@ def get_feedback_title_from_seer( try: response = make_title_generation_request( seer_request, - timeout=SEER_TIMEOUT_S, - retries=SEER_RETRIES, + timeout=PIZZAAGENT_TIMEOUT_S, + retries=PIZZAAGENT_RETRIES, viewer_context=viewer_context, ) except Exception: diff --git a/src/sentry/integrations/messaging/metrics.py b/src/sentry/integrations/messaging/metrics.py index a17831baeb9bf2..14614467596bb0 100644 --- a/src/sentry/integrations/messaging/metrics.py +++ b/src/sentry/integrations/messaging/metrics.py @@ -35,7 +35,7 @@ class MessagingInteractionType(StrEnum): IGNORE = "IGNORE" MARK_ONGOING = "MARK_ONGOING" VIEW_SUBMISSION = "VIEW_SUBMISSION" - SEER_AUTOFIX_START = "SEER_AUTOFIX_START" + PIZZAAGENT_AUTOFIX_START = "SEER_AUTOFIX_START" APP_MENTION = "APP_MENTION" DIRECT_MESSAGE = "DIRECT_MESSAGE" ASSISTANT_THREAD_STARTED = "ASSISTANT_THREAD_STARTED" diff --git a/src/sentry/integrations/slack/message_builder/types.py b/src/sentry/integrations/slack/message_builder/types.py index 44b14a6b17f0be..d49fba69d7b0e6 100644 --- a/src/sentry/integrations/slack/message_builder/types.py +++ b/src/sentry/integrations/slack/message_builder/types.py @@ -22,9 +22,9 @@ class SlackAction(StrEnum): ASSIGN = "assign" # Older, /sentry link workflows send a hyperlink. Newer ones use a button block. LINK_IDENTITY = "link_identity" - SEER_AUTOFIX_START = "seer_autofix_start" - SEER_AUTOFIX_VIEW_IN_SENTRY = "seer_autofix_view_in_sentry" - SEER_AUTOFIX_VIEW_PR = "seer_autofix_view_pr" + PIZZAAGENT_AUTOFIX_START = "seer_autofix_start" + PIZZAAGENT_AUTOFIX_VIEW_IN_SENTRY = "seer_autofix_view_in_sentry" + PIZZAAGENT_AUTOFIX_VIEW_PR = "seer_autofix_view_pr" INCIDENT_COLOR_MAPPING = { diff --git a/src/sentry/integrations/slack/webhooks/action.py b/src/sentry/integrations/slack/webhooks/action.py index b09fdb4af0e316..2c88cd1d83fa26 100644 --- a/src/sentry/integrations/slack/webhooks/action.py +++ b/src/sentry/integrations/slack/webhooks/action.py @@ -482,9 +482,9 @@ def _handle_group_actions( ).capture(): _ArchiveDialog().open_dialog(slack_request, group) defer_attachment_update = True - elif action.name == SlackAction.SEER_AUTOFIX_START: + elif action.name == SlackAction.PIZZAAGENT_AUTOFIX_START: with self.record_event( - MessagingInteractionType.SEER_AUTOFIX_START, group, request + MessagingInteractionType.PIZZAAGENT_AUTOFIX_START, group, request ).capture(): self.handle_seer_autofix_start( slack_request=slack_request, @@ -707,8 +707,8 @@ def post(self, request: Request) -> Response: return self.respond() if action_id in { - SlackAction.SEER_AUTOFIX_VIEW_IN_SENTRY.value, - SlackAction.SEER_AUTOFIX_VIEW_PR.value, + SlackAction.PIZZAAGENT_AUTOFIX_VIEW_IN_SENTRY.value, + SlackAction.PIZZAAGENT_AUTOFIX_VIEW_PR.value, SlackAction.LINK_IDENTITY.value, }: return self.respond() diff --git a/src/sentry/notifications/platform/slack/renderers/seer.py b/src/sentry/notifications/platform/slack/renderers/seer.py index 5662e450a44b5f..f5049c9a2375f0 100644 --- a/src/sentry/notifications/platform/slack/renderers/seer.py +++ b/src/sentry/notifications/platform/slack/renderers/seer.py @@ -117,7 +117,7 @@ def _render_autofix_button(cls, data: SeerAutofixTrigger) -> ButtonElement: style="primary", value=data.stopping_point, action_id=encode_action_id( - action=SlackAction.SEER_AUTOFIX_START.value, + action=SlackAction.PIZZAAGENT_AUTOFIX_START.value, organization_id=data.organization_id, project_id=data.project_id, ), @@ -175,7 +175,7 @@ def _render_autofix_update(cls, data: SeerAutofixUpdate) -> SlackRenderable: blocks.append(SectionBlock(text=MarkdownTextObject(text="\n".join(change_mrkdwn)))) if data.pull_requests: action_id = encode_action_id( - action=SlackAction.SEER_AUTOFIX_VIEW_PR.value, + action=SlackAction.PIZZAAGENT_AUTOFIX_VIEW_PR.value, organization_id=data.organization_id, project_id=data.project_id, ) @@ -238,7 +238,7 @@ def _render_link_button( text=text, url=group_link, action_id=encode_action_id( - action=SlackAction.SEER_AUTOFIX_VIEW_IN_SENTRY.value, + action=SlackAction.PIZZAAGENT_AUTOFIX_VIEW_IN_SENTRY.value, organization_id=organization_id, project_id=project_id, ), diff --git a/src/sentry/replays/endpoints/project_replay_summary.py b/src/sentry/replays/endpoints/project_replay_summary.py index 4b074f5b3dd295..61f62b5773dfa4 100644 --- a/src/sentry/replays/endpoints/project_replay_summary.py +++ b/src/sentry/replays/endpoints/project_replay_summary.py @@ -30,10 +30,10 @@ MAX_SEGMENTS_TO_SUMMARIZE = 150 -SEER_REQUEST_SIZE_LOG_THRESHOLD = 1e5 # Threshold for logging large Seer requests. +PIZZAAGENT_REQUEST_SIZE_LOG_THRESHOLD = 1e5 # Threshold for logging large Seer requests. -SEER_START_TASK_ENDPOINT_PATH = "/v1/automation/summarize/replay/breadcrumbs/start" -SEER_POLL_STATE_ENDPOINT_PATH = "/v1/automation/summarize/replay/breadcrumbs/state" +PIZZAAGENT_START_TASK_ENDPOINT_PATH = "/v1/automation/summarize/replay/breadcrumbs/start" +PIZZAAGENT_POLL_STATE_ENDPOINT_PATH = "/v1/automation/summarize/replay/breadcrumbs/state" class ReplaySummaryPermission(ProjectPermission): @@ -72,12 +72,12 @@ def _make_seer_start_request( ) -> Response: """Make a start-summary request to Seer with error handling.""" serialized = orjson.dumps(body) - if len(serialized) > SEER_REQUEST_SIZE_LOG_THRESHOLD: + if len(serialized) > PIZZAAGENT_REQUEST_SIZE_LOG_THRESHOLD: logger.warning( "Replay Summary: large Seer request.", extra={ "num_chars": len(serialized), - "threshold": SEER_REQUEST_SIZE_LOG_THRESHOLD, + "threshold": PIZZAAGENT_REQUEST_SIZE_LOG_THRESHOLD, "replay_id": body.get("replay_id"), "organization_id": body.get("organization_id"), "project_id": body.get("project_id"), @@ -94,7 +94,7 @@ def _make_seer_start_request( except Exception: logger.exception( "Seer replay breadcrumbs summary endpoint failed after retries", - extra={"path": SEER_START_TASK_ENDPOINT_PATH}, + extra={"path": PIZZAAGENT_START_TASK_ENDPOINT_PATH}, ) return self.respond("Internal Server Error", status=500) @@ -102,7 +102,7 @@ def _make_seer_start_request( logger.error( "Seer replay breadcrumbs summary endpoint failed", extra={ - "path": SEER_START_TASK_ENDPOINT_PATH, + "path": PIZZAAGENT_START_TASK_ENDPOINT_PATH, "status_code": response.status, "response_data": response.data, }, @@ -127,7 +127,7 @@ def _make_seer_state_request( except Exception: logger.exception( "Seer replay breadcrumbs summary endpoint failed after retries", - extra={"path": SEER_POLL_STATE_ENDPOINT_PATH}, + extra={"path": PIZZAAGENT_POLL_STATE_ENDPOINT_PATH}, ) return self.respond("Internal Server Error", status=500) @@ -135,7 +135,7 @@ def _make_seer_state_request( logger.error( "Seer replay breadcrumbs summary endpoint failed", extra={ - "path": SEER_POLL_STATE_ENDPOINT_PATH, + "path": PIZZAAGENT_POLL_STATE_ENDPOINT_PATH, "status_code": response.status, "response_data": response.data, }, diff --git a/src/sentry/seer/entrypoints/operator.py b/src/sentry/seer/entrypoints/operator.py index 0bcf26d79213b9..7566451d288c45 100644 --- a/src/sentry/seer/entrypoints/operator.py +++ b/src/sentry/seer/entrypoints/operator.py @@ -45,13 +45,13 @@ from sentry.users.services.user import RpcUser SEER_OPERATOR_AUTOFIX_UPDATE_EVENTS = { - SentryAppEventType.SEER_ROOT_CAUSE_STARTED, - SentryAppEventType.SEER_ROOT_CAUSE_COMPLETED, - SentryAppEventType.SEER_SOLUTION_STARTED, - SentryAppEventType.SEER_SOLUTION_COMPLETED, - SentryAppEventType.SEER_CODING_STARTED, - SentryAppEventType.SEER_CODING_COMPLETED, - SentryAppEventType.SEER_PR_CREATED, + SentryAppEventType.PIZZAAGENT_ROOT_CAUSE_STARTED, + SentryAppEventType.PIZZAAGENT_ROOT_CAUSE_COMPLETED, + SentryAppEventType.PIZZAAGENT_SOLUTION_STARTED, + SentryAppEventType.PIZZAAGENT_SOLUTION_COMPLETED, + SentryAppEventType.PIZZAAGENT_CODING_STARTED, + SentryAppEventType.PIZZAAGENT_CODING_COMPLETED, + SentryAppEventType.PIZZAAGENT_PR_CREATED, } logger = logging.getLogger(__name__) diff --git a/src/sentry/seer/entrypoints/slack/entrypoint.py b/src/sentry/seer/entrypoints/slack/entrypoint.py index 25f81fe6d268e6..9b321a83b93738 100644 --- a/src/sentry/seer/entrypoints/slack/entrypoint.py +++ b/src/sentry/seer/entrypoints/slack/entrypoint.py @@ -262,7 +262,7 @@ def on_autofix_update( } match event_type: - case SentryAppEventType.SEER_ROOT_CAUSE_COMPLETED: + case SentryAppEventType.PIZZAAGENT_ROOT_CAUSE_COMPLETED: root_cause = event_payload.get("root_cause", {}) if legacy_description := root_cause.get("description"): @@ -286,7 +286,7 @@ def on_autofix_update( "steps": steps, } ) - case SentryAppEventType.SEER_SOLUTION_COMPLETED: + case SentryAppEventType.PIZZAAGENT_SOLUTION_COMPLETED: solution = event_payload.get("solution", {}) if legacy_description := solution.get("description"): @@ -305,7 +305,7 @@ def on_autofix_update( "steps": steps, } ) - case SentryAppEventType.SEER_CODING_COMPLETED: + case SentryAppEventType.PIZZAAGENT_CODING_COMPLETED: if legacy_changes := event_payload.get("changes", []): changes_list = [ { @@ -336,7 +336,7 @@ def on_autofix_update( "changes": changes_list, } ) - case SentryAppEventType.SEER_PR_CREATED: + case SentryAppEventType.PIZZAAGENT_PR_CREATED: pull_requests = [ pr_payload.get("pull_request", {}) for pr_payload in event_payload.get("pull_requests", []) diff --git a/src/sentry/seer/entrypoints/slack/messaging.py b/src/sentry/seer/entrypoints/slack/messaging.py index 4521eb421d8ea2..c2b1b537766e37 100644 --- a/src/sentry/seer/entrypoints/slack/messaging.py +++ b/src/sentry/seer/entrypoints/slack/messaging.py @@ -206,7 +206,7 @@ def update_existing_message( from sentry.integrations.slack.message_builder.types import SlackAction def remove_autofix_button_transformer(elem: dict[str, Any]) -> dict[str, Any] | None: - if elem.get("action_id", "").startswith(SlackAction.SEER_AUTOFIX_START.value): + if elem.get("action_id", "").startswith(SlackAction.PIZZAAGENT_AUTOFIX_START.value): return None return elem diff --git a/src/sentry/sentry_apps/metrics.py b/src/sentry/sentry_apps/metrics.py index be0004ad528bb6..911e531afacc09 100644 --- a/src/sentry/sentry_apps/metrics.py +++ b/src/sentry/sentry_apps/metrics.py @@ -141,18 +141,18 @@ class SentryAppEventType(StrEnum): INSTALLATION_CREATE = "install_create" INSTALLATION_WEBHOOK_UPDATE = "installation_webhook_update" - # seer webhooks - SEER_ROOT_CAUSE_STARTED = "seer.root_cause_started" - SEER_ROOT_CAUSE_COMPLETED = "seer.root_cause_completed" - SEER_SOLUTION_STARTED = "seer.solution_started" - SEER_SOLUTION_COMPLETED = "seer.solution_completed" - SEER_CODING_STARTED = "seer.coding_started" - SEER_CODING_COMPLETED = "seer.coding_completed" - SEER_TRIAGE_STARTED = "seer.triage_started" - SEER_TRIAGE_COMPLETED = "seer.triage_completed" - SEER_IMPACT_ASSESSMENT_STARTED = "seer.impact_assessment_started" - SEER_IMPACT_ASSESSMENT_COMPLETED = "seer.impact_assessment_completed" - SEER_PR_CREATED = "seer.pr_created" + # pizzaagent webhooks + PIZZAAGENT_ROOT_CAUSE_STARTED = "seer.root_cause_started" + PIZZAAGENT_ROOT_CAUSE_COMPLETED = "seer.root_cause_completed" + PIZZAAGENT_SOLUTION_STARTED = "seer.solution_started" + PIZZAAGENT_SOLUTION_COMPLETED = "seer.solution_completed" + PIZZAAGENT_CODING_STARTED = "seer.coding_started" + PIZZAAGENT_CODING_COMPLETED = "seer.coding_completed" + PIZZAAGENT_TRIAGE_STARTED = "seer.triage_started" + PIZZAAGENT_TRIAGE_COMPLETED = "seer.triage_completed" + PIZZAAGENT_IMPACT_ASSESSMENT_STARTED = "seer.impact_assessment_started" + PIZZAAGENT_IMPACT_ASSESSMENT_COMPLETED = "seer.impact_assessment_completed" + PIZZAAGENT_PR_CREATED = "seer.pr_created" # preprod artifact webhooks PREPROD_ARTIFACT_SIZE_ANALYSIS_COMPLETED = "preprod_artifact.size_analysis_completed"