feat(autofix): Allow users to add feedback when rethinking#110695
feat(autofix): Allow users to add feedback when rethinking#110695
Conversation
We want to allow users to give some feedback to the agent when rethinking. This shows a textarea to accept input and passes that along when rethinking.
| if (userFeedback) { | ||
| data.user_feedback = userFeedback; | ||
| } |
There was a problem hiding this comment.
Bug: The user_feedback data sent from the frontend is silently dropped by the backend because the ExplorerAutofixRequestSerializer is missing the corresponding field.
Severity: HIGH
Suggested Fix
Add a user_feedback field to the ExplorerAutofixRequestSerializer in src/sentry/seer/endpoints/group_ai_autofix.py. Then, update the _post_explorer method to read this value from the serializer's validated data and pass it to the trigger_autofix_explorer function. The trigger_autofix_explorer function signature will also need to be updated to accept and process the feedback.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: static/app/components/events/autofix/useExplorerAutofix.tsx#L554-L556
Potential issue: The frontend correctly sends `user_feedback` data when starting an
autofix step. However, this data is silently ignored by the backend. The
`ExplorerAutofixRequestSerializer` in `src/sentry/seer/endpoints/group_ai_autofix.py`
lacks a `user_feedback` field, causing Django REST Framework to drop it from the request
data. Consequently, the feedback is never passed to the `trigger_autofix_explorer`
function and has no effect on the autofix agent's behavior. This makes the user feedback
feature non-functional.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
|
|
||
| if (userFeedback) { | ||
| data.user_feedback = userFeedback; | ||
| } |
There was a problem hiding this comment.
User feedback is silently dropped by backend serializer
High Severity
The frontend now sends user_feedback in the POST request body, but the backend ExplorerAutofixRequestSerializer does not declare a user_feedback field. DRF serializers strip undeclared fields from validated_data, so the feedback is silently dropped and never reaches trigger_autofix_explorer. The core feature of this PR — passing user feedback when rethinking — won't actually work until a corresponding user_feedback field is added to the backend serializer and plumbed through to trigger_autofix_explorer.
| setWaitingForResponse(true); | ||
|
|
||
| try { | ||
| const data: Record<string, any> = {step}; |
There was a problem hiding this comment.
Refactoring accidentally removed intelligence_level from request data
Low Severity
The refactoring to support user_feedback accidentally dropped intelligence_level: 'low' from the POST request data. The backend serializer happens to default to 'low', so behavior is currently preserved, but the explicit field was clearly intentional and its silent removal could cause issues if the backend default changes.


We want to allow users to give some feedback to the agent when rethinking. This shows a textarea to accept input and passes that along when rethinking.