From 1baf15fc42b88bc52b98309f517dcb32700418d0 Mon Sep 17 00:00:00 2001 From: Nico Hinderling Date: Wed, 7 Oct 2026 11:18:02 -0700 Subject: [PATCH] feat(autofix): Send PR context tools option for PR iteration Send enable_pr_context_tools in the Autofix feature dispatch's agent run options, true for PR iteration and false for the other steps, next to enable_coding. Seer currently forces the flag on for the step; sending it from here lets Seer pass the options through like every other step, so the decision lives in one place. Refs getsentry/seer#8693 --- src/sentry/seer/agent/client_utils.py | 1 + src/sentry/seer/autofix/feature/dispatch.py | 1 + tests/sentry/seer/autofix/feature/test_dispatch.py | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/sentry/seer/agent/client_utils.py b/src/sentry/seer/agent/client_utils.py index 20011add9a8d..263faa2964e1 100644 --- a/src/sentry/seer/agent/client_utils.py +++ b/src/sentry/seer/agent/client_utils.py @@ -138,6 +138,7 @@ class AgentRunOptions(TypedDict): is_context_engine_enabled: NotRequired[bool] enable_bash_mode: NotRequired[bool] enable_coding: NotRequired[bool] + enable_pr_context_tools: NotRequired[bool] enable_tool_summary: NotRequired[bool] embed_widgets: NotRequired[list[dict[str, Any]] | None] enable_streaming: NotRequired[bool] diff --git a/src/sentry/seer/autofix/feature/dispatch.py b/src/sentry/seer/autofix/feature/dispatch.py index a71edd794d4d..ac7adb0b6630 100644 --- a/src/sentry/seer/autofix/feature/dispatch.py +++ b/src/sentry/seer/autofix/feature/dispatch.py @@ -107,6 +107,7 @@ def trigger_autofix_feature( is_context_engine_enabled=False, enable_frontend_code_search=False, enable_coding=enable_coding, + enable_pr_context_tools=args.step == AutofixStep.PR_ITERATION, ) extras: dict[str, Any] = { diff --git a/tests/sentry/seer/autofix/feature/test_dispatch.py b/tests/sentry/seer/autofix/feature/test_dispatch.py index 1427654f72f4..dae50ab7dc80 100644 --- a/tests/sentry/seer/autofix/feature/test_dispatch.py +++ b/tests/sentry/seer/autofix/feature/test_dispatch.py @@ -279,6 +279,7 @@ def test_code_changes_enables_coding(self) -> None: "agent_run_options" ] assert agent_run_options["enable_coding"] is True + assert agent_run_options["enable_pr_context_tools"] is False def test_pr_iteration_enables_coding_and_sends_its_step_args(self) -> None: fake_run = self.create_seer_run(organization=self.organization, seer_run_state_id=123) @@ -308,6 +309,7 @@ def test_pr_iteration_enables_coding_and_sends_its_step_args(self) -> None: assert mock_client_cls.call_args.kwargs["enable_coding"] is True continue_kwargs = mock_client_cls.return_value.continue_feature_run.call_args.kwargs assert continue_kwargs["agent_run_options"]["enable_coding"] is True + assert continue_kwargs["agent_run_options"]["enable_pr_context_tools"] is True assert continue_kwargs["payload"]["step_args"] == { "iteration_index": 2, "iteration_id": 41,