fix(seer): Branch trigger_handoff on autofix-on-explorer flag#114360
Merged
fix(seer): Branch trigger_handoff on autofix-on-explorer flag#114360
Conversation
trigger_handoff always called get_autofix_state which hits the autofix state endpoint. When autofix-on-explorer is enabled, the run_id is an Explorer-type run, causing a StateTypeMismatchError from Seer. Branch on the organizations:autofix-on-explorer flag to use fetch_run_status (explorer endpoint) when enabled, matching how trigger_autofix already branches. The dedup check works for both state types since they share the same status values. Fixes SENTRY-5P7A Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The multiline @patch decorator with side_effect was missed by the earlier replace_all, leaving it patching the source module instead of the import site in operator.py. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SeerOperatorCompletionHook.execute had its own local import of fetch_run_status, bypassing the module-level import. Tests mock at the module level, so the local import caused them to hit the real endpoint. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
cleptric
pushed a commit
that referenced
this pull request
May 5, 2026
- `trigger_handoff` always called `get_autofix_state` (autofix endpoint), but when `autofix-on-explorer` is enabled the cached `run_id` is an explorer-type run, causing a `StateTypeMismatchError` and 500 from seer. - this branches on the feature flag to use `fetch_run_status` (explorer endpoint) when enabled, matching how `trigger_autofix` already works, and adds test coverage for the explorer path. Fixes SENTRY-5P7A <img width="452" height="171" alt="image" src="https://github.com/user-attachments/assets/08d99008-91fc-4955-a3cf-eb5aad08d955" /> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
trigger_handoffalways calledget_autofix_state(autofix endpoint), but whenautofix-on-exploreris enabled the cachedrun_idis an explorer-type run, causing aStateTypeMismatchErrorand 500 from seer.fetch_run_status(explorer endpoint) when enabled, matching howtrigger_autofixalready works, and adds test coverage for the explorer path.Fixes SENTRY-5P7A