ref(seer): Return SeerRun from start_run to drop a re-query#117025
Merged
Conversation
Graduate the SeerRun mirror rollout: remove the organizations:seer-run-mirror, seer-run-mirror-explorer, and seer-run-mirror-autofix feature flags so the outbox-based double-write always runs for explorer and assisted-query starts. The direct-HTTP fallbacks are now dead and removed. Delete the legacy non-agent autofix scaffolding (SeerRunType.AUTOFIX, the receiver's AUTOFIX dispatch arm, and make_autofix_start_request). Agent-based autofix runs through SeerAgentClient.start_run, so nothing created AUTOFIX rows; the path was removed with legacy autofix. Bump last_triggered_at in continue_run to mirror Seer's mark_triggered() so an actively-continued run reflects recent activity for the recency indexes and TTL cleanup, rather than only its first-trigger time. Co-Authored-By: Claude <noreply@anthropic.com>
SeerAgentClient.start_run now returns the SeerRun it creates instead of just its seer_run_state_id. The night-shift agentic_triage path uses the returned run directly, removing a redundant SeerRun.objects.filter(seer_run_state_id=...).first() lookup along with the silent-None path it carried (a missed mirror left the run FK unset). Wire-facing callers (agent chat, dashboard) and trigger_autofix_agent read .seer_run_state_id off the returned run, so the API run_id contract is unchanged. continue_run still returns an int since it creates no run. Co-Authored-By: Claude <noreply@anthropic.com>
…eturns-seer-run # Conflicts: # src/sentry/seer/agent/client.py # tests/sentry/seer/endpoints/test_organization_seer_agent_chat.py
NicoHinderling
approved these changes
Jun 5, 2026
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.
SeerAgentClient.start_runnow returns theSeerRunit creates instead of justseer_run_state_id.This lets the night-shift
agentic_triagepath use the run directly and drop a redundantSeerRun.objects.filter(seer_run_state_id=...).first()lookup (which also silently leftSeerNightShiftRun.seer_rununset on a miss).Wire-facing callers and
trigger_autofix_agentread.seer_run_state_id, so the APIrun_idresponse is unchanged.continue_runstill returns anint.