Skip to content

feat(autofix): Allow users to add feedback when rethinking#110695

Open
Zylphrex wants to merge 1 commit intomasterfrom
txiao/feat/allow-users-to-add-feedback-when-rethinking
Open

feat(autofix): Allow users to add feedback when rethinking#110695
Zylphrex wants to merge 1 commit intomasterfrom
txiao/feat/allow-users-to-add-feedback-when-rethinking

Conversation

@Zylphrex
Copy link
Member

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.

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.
@Zylphrex Zylphrex requested a review from a team as a code owner March 13, 2026 22:26
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 13, 2026
Comment on lines +554 to +556
if (userFeedback) {
data.user_feedback = userFeedback;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
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 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.


if (userFeedback) {
data.user_feedback = userFeedback;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

setWaitingForResponse(true);

try {
const data: Record<string, any> = {step};
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant