Prevent code generation setting bypasses#111294
Conversation
Backend Test FailuresFailures on
|
There was a problem hiding this comment.
TypeError when request.data is a list due to unvalidated dict unpacking (src/sentry/seer/endpoints/organization_seer_explorer_update.py:52)
Line 52 correctly handles non-dict request.data by checking isinstance(request.data, dict) before calling .get(), but line 66 uses **request.data without ensuring request.data is a dict. If a client sends a JSON array (e.g., [{"type": "create_pr"}]) instead of a JSON object, the dict unpacking will raise TypeError: 'list' object is not a mapping, causing a 500 error.
Identified by Warden sentry-backend-bugs
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Missing
create_branchin autofix coding payload guard- Updated
CODING_UPDATE_PAYLOAD_TYPESinupdate_autofix()to includecreate_branch, aligning the chokepoint guard with endpoint-level coding payload checks.
- Updated
Or push these changes by commenting:
@cursor push 0b1222bfcf
Preview (0b1222bfcf)
diff --git a/src/sentry/seer/autofix/autofix.py b/src/sentry/seer/autofix/autofix.py
--- a/src/sentry/seer/autofix/autofix.py
+++ b/src/sentry/seer/autofix/autofix.py
@@ -823,7 +823,7 @@
)
-CODING_UPDATE_PAYLOAD_TYPES = frozenset({"select_solution", "create_pr"})
+CODING_UPDATE_PAYLOAD_TYPES = frozenset({"select_solution", "create_branch", "create_pr"})
def update_autofix(This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Unused constant added with no consumers
- Confirmed the constant had no references and removed
AUTOFIX_AUTOMATION_OCCURRENCE_THRESHOLDfrom the constants module.
- Confirmed the constant had no references and removed
Or push these changes by commenting:
@cursor push 1ab3d81c95
Preview (1ab3d81c95)
diff --git a/src/sentry/seer/autofix/constants.py b/src/sentry/seer/autofix/constants.py
--- a/src/sentry/seer/autofix/constants.py
+++ b/src/sentry/seer/autofix/constants.py
@@ -2,11 +2,7 @@
CODING_PAYLOAD_TYPES = frozenset({"select_solution", "create_branch", "create_pr"})
-# An issue group must have >= this number of occurrences in order to be
-# a target for 'workflow' autofix.
-AUTOFIX_AUTOMATION_OCCURRENCE_THRESHOLD = 10
-
class FixabilityScoreThresholds(enum.Enum):
SUPER_HIGH = 0.76
HIGH = 0.66This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
# Conflicts: # src/sentry/seer/autofix/constants.py # tests/sentry/seer/autofix/test_autofix_agent.py
Backend Test FailuresFailures on
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Backend Test FailuresFailures on
|
b674eb6 to
8334244
Compare
Backend Test FailuresFailures on
|
# Conflicts: # tests/sentry/seer/autofix/test_autofix_agent.py


It's the second time we have a bypass of this organization setting which allowed for code gen, new branches, and new PRs. Fixing this upstream in chokepoints rather than in all the endpoints since RPC callbacks, on-complete hooks, and slack flows lacked enforcement too.
Added check to:
Plus a bunch of tests