Skip to content

Conversation

@Mihir-Mavalankar
Copy link
Contributor

@Mihir-Mavalankar Mihir-Mavalankar commented Nov 12, 2025

  • With the V0 launch, we are asking the model to decide a stopping stage for autofix but we are still keeping the user setting to decide the stopping point.
  • This adds logic to upper bound the stopping stage with the user preference.
  • Notion doc reference
  • Further optimization - we can cache user preferences for a an hour or so reduce API calls.

@Mihir-Mavalankar Mihir-Mavalankar self-assigned this Nov 12, 2025
@Mihir-Mavalankar Mihir-Mavalankar requested a review from a team as a code owner November 12, 2025 17:31
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 12, 2025
return preference.get("automated_run_stopping_point")
return None
except Exception:
logger.warning(
Copy link
Member

@JoshFerge JoshFerge Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we work at sentry, it'd be ideal if we could use sentry's error capturing instead of logging the stacktrace. you can do so by doing `sentry.capture_exception(e,level='warning').

additionally, should this be warning? seems like if this happens it would be bad. maybe just capture the exception as error level?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not that bad because if we can't fetch this since we will still have the fixability stopping point and Seer had additional checks and preference fetching logic (in some cases).
I'll make it an error for now so we don't ignore it and see how often it fails.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but why wouldn't we be able to fetch it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case Seer autofix pods are completely down, networking issues making them unreachable, or they are overloaded leading to timeouts. It's rare but it can happen.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, so i think that an error level makes sense

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense it's exception now and capturing it via sentry.

Comment on lines +352 to +361
logger.info("Fixability-based stopping point: %s", fixability_stopping_point)

# Fetch user preference and apply as upper bound
user_preference = _fetch_user_preference(group.project.id)
logger.info("User preference stopping point: %s", user_preference)

stopping_point = _apply_user_preference_upper_bound(
fixability_stopping_point, user_preference
)
logger.info("Final stopping point after upper bound: %s", stopping_point)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these logs necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are a bit extra but I was thinking to keep them in for now to validate everything and in case we see something unexpected. I do plan to remove them soon.

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##           master   #103237       +/-   ##
============================================
+ Coverage   68.84%    80.70%   +11.85%     
============================================
  Files        9220      9226        +6     
  Lines      393563    393995      +432     
  Branches    25089     25089               
============================================
+ Hits       270947    317970    +47023     
+ Misses     122168     75577    -46591     
  Partials      448       448               

@Mihir-Mavalankar Mihir-Mavalankar merged commit 34fa697 into master Nov 12, 2025
66 checks passed
@Mihir-Mavalankar Mihir-Mavalankar deleted the where-to-stop-upper-bound-logic branch November 12, 2025 21:31
andrewshie-sentry pushed a commit that referenced this pull request Nov 13, 2025
…ping point [feature flagged] (#103237)

+ With the V0 launch, we are asking the model to decide a stopping stage
for autofix but we are still keeping the user setting to decide the
stopping point.
+ This adds logic to upper bound the stopping stage with the user
preference.
+ Notion doc
[reference](https://www.notion.so/sentry/Triage-Signals-V0-Technical-Implementation-Details-2a18b10e4b5d8086a7ceddaf4194849a?source=copy_link#2a98b10e4b5d808c8799cb0000aaa853)
+ Further optimization - we can cache user preferences for a an hour or
so reduce API calls.
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.

4 participants