feat(seer): route root-cause autofix through the RCA feature#120100
Conversation
|
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
1f5c567 to
8cc9ed4
Compare
6323481 to
0e1459f
Compare
8cc9ed4 to
117fb46
Compare
0e1459f to
a95fbca
Compare
Sentry Snapshot Testing
|
| 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) |
There was a problem hiding this comment.
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:571src/sentry/seer/autofix/issue_summary.py:182src/sentry/tasks/seer/pr_iteration.py:211
Did we get this right? 👍 / 👎 to inform future reviews.
7078af9 to
8c359d4
Compare
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.
a95fbca to
02ed142
Compare

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