feat(seer): Rewrite the Seer > Project list page#109531
feat(seer): Rewrite the Seer > Project list page#109531
Conversation
…e need better api endpoints first
| } else if (autofixAgent && autofixAgent !== 'none') { | ||
| const updatedHandoff = { | ||
| handoff_point: 'root_cause' as const, | ||
| target: 'cursor_background_agent' as const, | ||
| integration_id: Number(autofixAgent.id), | ||
| ...preference?.automation_handoff, | ||
| auto_create_pr: value, | ||
| }; |
There was a problem hiding this comment.
Bug: In useMutateCreatePr, spreading preference?.automation_handoff after setting new values can cause stale data, like integration_id, to overwrite the intended configuration due to a race condition.
Severity: CRITICAL
Suggested Fix
Reverse the order of properties in the updatedHandoff object. Spread preference?.automation_handoff first, and then define the explicit properties like handoff_point, target, and integration_id. This ensures that the new, correct values always overwrite any potentially stale values from the preference object.
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/gsApp/views/seerAutomation/components/seerAgentHooks.tsx#L231-L238
Potential issue: In the `useMutateCreatePr` hook, the `updatedHandoff` object is
constructed by spreading `preference?.automation_handoff` after explicitly setting
`handoff_point`, `target`, and `integration_id`. This object spread order is incorrect.
If a user changes the selected agent and then quickly toggles the 'auto-create PR'
switch, a race condition can occur. The `preference` object may still contain stale data
from the previously selected agent. When spread, this stale data, particularly the
`integration_id`, will overwrite the new, correct values, causing the automation
settings to be saved with an incorrect agent ID.
Did we get this right? 👍 / 👎 to inform future reviews.
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.
| autofixSettings?.automatedRunStoppingPoint ?? 'code_changes', | ||
| automation_handoff: autofixSettings?.automationHandoff ?? undefined, | ||
| }; | ||
| }, [autofixSettings]); |
There was a problem hiding this comment.
Table row mutations wipe project repositories with empty array
High Severity
The preference object constructed in the table row hardcodes repositories: []. When useMutateSelectedAgent or useMutateCreatePr fires from this row, it sends repositories: [] to the /seer/preferences/ POST endpoint, which forwards the full payload (including the empty repositories array) to Seer's backend. This overwrites the project's actual configured repositories with an empty list, causing data loss. The bulk settings API only provides reposCount (a number), not the actual SeerRepoDefinition[] array, so the table row has no way to populate it correctly.


This rewrite consolidates some of the previous columns to match what's in #109349
Bulk editing is disabled. At this moment we don't have support for updating the complex
automation_handoffvalues in the current bulk edit endpoint.Fixes https://linear.app/getsentry/issue/CW-930/settings-seer-project-list-simplify-the-columnsactions-to-match
Depends on #110188