Skip to content

feat(seer): route root-cause autofix through the RCA feature#120100

Open
rbro112 wants to merge 1 commit into
ryan/07-20-feat_seer_add_autofix_rca_featurefrom
ryan/07-20-route_root_cause_autofix_through_rca_feature
Open

feat(seer): route root-cause autofix through the RCA feature#120100
rbro112 wants to merge 1 commit into
ryan/07-20-feat_seer_add_autofix_rca_featurefrom
ryan/07-20-route_root_cause_autofix_through_rca_feature

Conversation

@rbro112

@rbro112 rbro112 commented Jul 20, 2026

Copy link
Copy Markdown
Member

Wires up the new seer-driven RCA flow. Leverages the autofix-rca-in-seer feature flagg added in #120104 to branch and use the new feature when enabled.

@rbro112
rbro112 requested a review from a team as a code owner July 20, 2026 17:56
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 20, 2026

rbro112 commented Jul 20, 2026

Copy link
Copy Markdown
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@rbro112
rbro112 force-pushed the ryan/07-20-feat_seer_add_autofix_rca_feature branch from 1f5c567 to 8cc9ed4 Compare July 20, 2026 18:08
@rbro112
rbro112 force-pushed the ryan/07-20-route_root_cause_autofix_through_rca_feature branch from 6323481 to 0e1459f Compare July 20, 2026 18:08
@rbro112
rbro112 force-pushed the ryan/07-20-feat_seer_add_autofix_rca_feature branch from 8cc9ed4 to 117fb46 Compare July 20, 2026 18:59
@rbro112
rbro112 force-pushed the ryan/07-20-route_root_cause_autofix_through_rca_feature branch from 0e1459f to a95fbca Compare July 20, 2026 18:59
@sentry

sentry Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 451 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

Comment on lines +541 to +544
feature_run_id = feature_run.seer_run_state_id
if feature_run_id is None:
# flush=True populates this on success; guard defensively.
raise SeerApiError("autofix_rca feature run has no run id", 500)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The new SeerApiError raised by trigger_autofix_agent is not handled by several callers in async tasks, which will lead to silent task failures.
Severity: MEDIUM

Suggested Fix

Wrap the calls to trigger_autofix_agent in on_completion_hook.py, issue_summary.py, and pr_iteration.py with a try...except SeerApiError block to properly handle this new exception. This will prevent silent task failures and allow for explicit error logging or handling.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/sentry/seer/autofix/autofix_agent.py#L541-L544

Potential issue: The function `trigger_autofix_agent` can now raise a `SeerApiError` if
a `feature_run` object lacks a `seer_run_state_id`. This new exception is not handled in
three locations where the function is called within asynchronous tasks:
`on_completion_hook.py`, `issue_summary.py`, and `pr_iteration.py`. Consequently, if
this error condition occurs, the async tasks will fail. While the task framework may log
the exception, the application logic does not handle it explicitly, leading to silent
failures that are difficult to diagnose and obscure the root cause of the problem.

Also affects:

  • src/sentry/seer/autofix/on_completion_hook.py:571
  • src/sentry/seer/autofix/issue_summary.py:182
  • src/sentry/tasks/seer/pr_iteration.py:211

Did we get this right? 👍 / 👎 to inform future reviews.

@rbro112
rbro112 force-pushed the ryan/07-20-feat_seer_add_autofix_rca_feature branch 2 times, most recently from 7078af9 to 8c359d4 Compare July 23, 2026 01:02
Behind the organizations:autofix-rca-in-seer flag (already registered on
master), route new ROOT_CAUSE runs in trigger_autofix_agent to the autofix_rca
feature instead of the legacy explorer root-cause step, so every entrypoint
(post-process, night shift, manual, operator) picks it up. The feature is
RCA-only; deliver_autofix_rca_result surfaces the result back into the existing
webhooks/analytics.
@rbro112
rbro112 force-pushed the ryan/07-20-route_root_cause_autofix_through_rca_feature branch from a95fbca to 02ed142 Compare July 23, 2026 01:05
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.

1 participant