Skip to content

feat(seer): Plumb reasoning_effort through trigger_autofix_explorer#114357

Merged
trevor-e merged 5 commits intomasterfrom
feat/plumb-reasoning-effort-autofix
Apr 29, 2026
Merged

feat(seer): Plumb reasoning_effort through trigger_autofix_explorer#114357
trevor-e merged 5 commits intomasterfrom
feat/plumb-reasoning-effort-autofix

Conversation

@trevor-e
Copy link
Copy Markdown
Member

@trevor-e trevor-e commented Apr 29, 2026

trigger_autofix_explorer previously hardcoded reasoning_effort to STEP_CONFIGS[step].reasoning_effort, so callers couldn't override it.

Adds an optional reasoning_effort parameter that wins over the step default when provided, and threads the night-shift run's options["reasoning_effort"] through to it so per-run tweaks actually take effect.

Note: this PR also forwards options["intelligence_level"] through to trigger_autofix_explorer. That intentionally changes the effective default for cron-triggered night-shift runs from "medium" (the trigger_autofix_explorer parameter default) to "high" (DEFAULT_INTELLIGENCE_LEVEL). The night-shift options are now the single source of truth for both knobs.

trigger_autofix_explorer previously hardcoded reasoning_effort to
STEP_CONFIGS[step].reasoning_effort, leaving callers no way to override
it. Add an optional reasoning_effort parameter that overrides the step
default when provided, and forward the night-shift run's
options["reasoning_effort"] through to it.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 29, 2026
…xplorer

Add three regression tests:
- trigger_autofix_explorer falls back to STEP_CONFIGS[step].reasoning_effort
  when no override is supplied
- An explicit reasoning_effort kwarg wins over the step default
- The night-shift cron forwards options["reasoning_effort"] into
  trigger_autofix_explorer

Co-Authored-By: Claude <noreply@anthropic.com>
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 eb49649. Configure here.

Comment thread src/sentry/tasks/seer/night_shift/cron.py
…low"

The override test asserts the explicit "low" reasoning_effort wins over
the step default. If STEP_CONFIGS[ROOT_CAUSE].reasoning_effort ever
changed to "low", the assertion would pass coincidentally even if the
override plumbing broke. Assert the step default is not "low" so the
test fails loudly if that happens.

Co-Authored-By: Claude <noreply@anthropic.com>
@trevor-e trevor-e marked this pull request as ready for review April 29, 2026 20:40
@trevor-e trevor-e requested a review from a team as a code owner April 29, 2026 20:40
Comment thread src/sentry/seer/autofix/autofix_agent.py Outdated
trevor-e and others added 2 commits April 29, 2026 19:03
Use a module-level _UNSET sentinel as the default for the
reasoning_effort parameter so callers can distinguish three cases:

- not passed → fall back to STEP_CONFIGS[step].reasoning_effort
- "low" / "medium" / "high" → use that value
- None → bypass the step default and let the explorer client decide

This mirrors the pattern already in src/sentry/integrations/vsts/client.py.

Co-Authored-By: Claude <noreply@anthropic.com>
test_explicit_none_reasoning_effort_bypasses_step_default is strictly
more sensitive than the "low" override test — it catches every
regression the "low" test would, plus reintroductions of an
is-not-None or truthiness fallback.

Co-Authored-By: Claude <noreply@anthropic.com>
@trevor-e trevor-e merged commit 945e363 into master Apr 29, 2026
59 checks passed
@trevor-e trevor-e deleted the feat/plumb-reasoning-effort-autofix branch April 29, 2026 23:37
cleptric pushed a commit that referenced this pull request May 5, 2026
…114357)

`trigger_autofix_explorer` previously hardcoded `reasoning_effort` to
`STEP_CONFIGS[step].reasoning_effort`, so callers couldn't override it.

Adds an optional `reasoning_effort` parameter that wins over the step
default when provided, and threads the night-shift run's
`options["reasoning_effort"]` through to it so per-run tweaks actually
take effect.

Note: this PR also forwards `options["intelligence_level"]` through to
`trigger_autofix_explorer`. That intentionally changes the effective
default for cron-triggered night-shift runs from `"medium"` (the
`trigger_autofix_explorer` parameter default) to `"high"`
(`DEFAULT_INTELLIGENCE_LEVEL`). The night-shift options are now the
single source of truth for both knobs.

---------

Co-authored-by: Claude <noreply@anthropic.com>
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