Skip to content

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

Merged
Zylphrex merged 2 commits intomasterfrom
txiao/feat/allow-users-to-add-feedback-when-rethinking
Mar 16, 2026
Merged

feat(autofix): Allow users to add feedback when rethinking#110695
Zylphrex merged 2 commits 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.

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Intentionally removed to allow the backend to decide.

Comment on lines +555 to +556
data.user_context = userContext;
}
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_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.

@Zylphrex Zylphrex merged commit 0d7ca6a into master Mar 16, 2026
63 checks passed
@Zylphrex Zylphrex deleted the txiao/feat/allow-users-to-add-feedback-when-rethinking branch March 16, 2026 17:17
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.

3 participants