Skip to content

ref(autofix): Wire up code-solution-in-seer - #124995

Draft
rbro112 wants to merge 1 commit into
masterfrom
rbro112/autofix-solution-in-seer-v1
Draft

rbro112 wants to merge 1 commit into
masterfrom
rbro112/autofix-solution-in-seer-v1

Conversation

@rbro112

@rbro112 rbro112 commented Sep 18, 2026

Copy link
Copy Markdown
Member

Wires up moving the code-solution autofix step into Seer in prep for leveraging our evals platform.


Stack created with GitHub Stacks CLIGive Feedback 💬

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 18, 2026
@rbro112
rbro112 force-pushed the rbro112/autofix-solution-in-seer-v1 branch from 46ea9d5 to 29bb740 Compare September 19, 2026 00:08
Comment on lines +559 to +576
or (
step == AutofixStep.CODE_CHANGES
and features.has(
"organizations:autofix-code-changes-in-seer", group.organization, actor=user
)
)
)
if use_seer_feature:
if run_id is not None:
_assert_existing_run_belongs_to_group(group, run_id)

step_args: RCAStepArgs | SolutionStepArgs
step_args: RCAStepArgs | SolutionStepArgs | CodeChangesStepArgs
if step == AutofixStep.ROOT_CAUSE:
step_args = RCAStepArgs(repo_pins=_build_repo_pins(group, referrer))
elif step == AutofixStep.SOLUTION:
step_args = SolutionStepArgs(should_run_repo_checks=enable_bash_tools)
elif step == AutofixStep.CODE_CHANGES:
step_args = CodeChangesStepArgs(should_run_repo_checks=enable_bash_tools)

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.

CODE_CHANGES feature path skips enable_seer_coding guard

When organizations:autofix-code-changes-in-seer is on, CODE_CHANGES runs are dispatched without checking sentry:enable_seer_coding, so orgs that disabled code generation can still start coding runs via the API or other callers.

Evidence
  • Legacy CODE_CHANGES uses get_autofix_agent_client(..., enable_coding=True), and SeerAgentClient.__init__ raises SeerPermissionError when sentry:enable_seer_coding is false.
  • This change routes flagged CODE_CHANGES into trigger_autofix_feature before that client path runs.
  • trigger_autofix_feature builds SeerAgentClient without enable_coding=True and never reads sentry:enable_seer_coding.
  • GroupAutofixEndpoint can still call trigger_autofix_agent(..., step=CODE_CHANGES) for authenticated users, so the org disable control is skipped on the new path.
Also found at 2 additional locations
  • src/sentry/seer/autofix/feature/dispatch.py:42-42
  • src/sentry/seer/autofix/autofix_agent.py:47-47

Identified by Warden · security-review · UFK-M9E

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