Skip to content

ref(autofix): Remove the organizations:autofix-on-explorer feature flag#116165

Merged
chromy merged 2 commits into
masterfrom
chromy/2026-05-26-remove-autofix-on-explorer-flag
May 28, 2026
Merged

ref(autofix): Remove the organizations:autofix-on-explorer feature flag#116165
chromy merged 2 commits into
masterfrom
chromy/2026-05-26-remove-autofix-on-explorer-flag

Conversation

@chromy
Copy link
Copy Markdown
Contributor

@chromy chromy commented May 26, 2026

Summary

Third in a stack (follow-up to #116162 and #116164). The organizations:autofix-on-explorer flag is now true everywhere, so this PR removes it.

  • Drop the flag registration from temporary.py.
  • Collapse every features.has("organizations:autofix-on-explorer", ...) check to the True branch:
    • search/snuba/backend.py — always use the seer_explorer_autofix_last_triggered column
    • seer/autofix/issue_summary.py — always route to trigger_autofix_agent; remove the legacy fallback
    • seer/agent/client_utils.py — gate only on organizations:seer-explorer (collapse the dual-flag batch_has to a single features.has)
    • seer/entrypoints/operator.pytrigger_autofix always calls the agent path; trigger_handoff always fetches via fetch_run_status
  • Delete the trigger_autofix_legacy method on SeerAutofixOperator (no callers remain) and its dead legacy imports.
  • Tests: drop the legacy-path tests in test_operator.py, rename the no-longer-distinguished explorer tests, and de-flag the remaining tests.

Net: 9 files changed, 42 insertions, 667 deletions.

Agent transcript: https://claudescope.sentry.dev/share/XIAoRxeHQ-AT-i3eUi_fVXryk-kKsNjn_0qaxBkUXqE

@chromy chromy requested review from a team as code owners May 26, 2026 10:59
Comment thread src/sentry/seer/agent/client_utils.py
@chromy chromy force-pushed the chromy/2026-05-26-autofix-remove-legacy-deadcode branch from eace939 to 20264c4 Compare May 26, 2026 14:16
Base automatically changed from chromy/2026-05-26-autofix-remove-legacy-deadcode to master May 26, 2026 15:01
@chromy chromy force-pushed the chromy/2026-05-26-remove-autofix-on-explorer-flag branch from 61cb923 to 2bf272c Compare May 27, 2026 10:12
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 27, 2026
Comment thread src/sentry/seer/entrypoints/operator.py
chromy added 2 commits May 28, 2026 10:48
This flag is now fully rolled out. Remove the flag registration and
collapse all call sites to take the True branch:

- `search/snuba/backend.py`: always use `seer_explorer_autofix_last_triggered`
- `seer/autofix/issue_summary.py`: always route to `trigger_autofix_agent`
- `seer/agent/client_utils.py`: gate only on `organizations:seer-explorer`
- `seer/entrypoints/operator.py`: `trigger_autofix` always calls the agent
  path; the legacy handoff branch in `trigger_handoff` is removed

Drop the now-dead `trigger_autofix_legacy` method and its legacy autofix
imports. Remove the tests that exercised those dead code paths; the
remaining explorer-path tests are de-flagged and their helpers cleaned
up.

Agent transcript: https://claudescope.sentry.dev/share/4xBciP_4JyKS5m-3OPFGifbPT2RgHiyfmeiyXOGZjAo
After removing `trigger_autofix_legacy`, `get_stopping_point_status`,
`get_latest_cause_id`, and `AUTOFIX_FALLBACK_CAUSE_ID` no longer have
any callers. Drop them along with the now-unused `AutofixState` import.

Co-Authored-By: Claude <[email protected]>

Agent transcript: https://claudescope.sentry.dev/share/lVRsatFnt9RUCKag81CcEOLGLMmYq-sL0yPvuoLgmZk
@chromy chromy force-pushed the chromy/2026-05-26-remove-autofix-on-explorer-flag branch from 246faa0 to 1eb8368 Compare May 28, 2026 09:49
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 1 potential issue.

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 1eb8368. Configure here.

pass
else:
response = trigger_legacy_autofix(
try:
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.

Task parameters became dead code after removal

Low Severity

The parameters event_id, user_id, and auto_run_source in _trigger_autofix_task are now completely unused after the legacy code path was removed. They were previously consumed by trigger_legacy_autofix and the user-fetching logic, both of which are gone. The caller in run_automation still computes and passes all three values. While keeping them temporarily is reasonable for in-flight task compatibility, they represent dead code that adds confusion.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1eb8368. Configure here.

@chromy chromy merged commit 80847f9 into master May 28, 2026
84 checks passed
@chromy chromy deleted the chromy/2026-05-26-remove-autofix-on-explorer-flag branch May 28, 2026 10:17
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