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.
| 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.
There was a problem hiding this comment.
Intentionally removed to allow the backend to decide.
| data.user_context = userContext; | ||
| } |
There was a problem hiding this comment.
Bug: The user_context sent from the frontend is not handled by the backend, causing user feedback for the autofix rethink feature to be silently ignored.
Severity: HIGH
Suggested Fix
Update the backend to handle the user_context. This involves adding the user_context field to the ExplorerAutofixRequestSerializer, passing it through the trigger_autofix_explorer function, and forwarding it to the Seer Explorer client's continue_run method.
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#L555-L556
Potential issue: The frontend sends a `user_context` field when a user provides feedback
for the autofix feature. However, the backend `ExplorerAutofixRequestSerializer` does
not define this field, causing Django REST Framework to silently drop it. Consequently,
the user's feedback is never passed to the `trigger_autofix_explorer` function or the
underlying Seer Explorer agent. This makes the entire "rethink" feedback feature
non-functional, as the user's input has no effect on the autofix process.


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.