Skip to content

feat(seer): Setup Agent bulk-edit on the Seer Autofix list page, and bring back Create PR bulk edits#112249

Open
ryan953 wants to merge 1 commit intomasterfrom
ryan953/seer-autofix-bulk-agent-edit
Open

feat(seer): Setup Agent bulk-edit on the Seer Autofix list page, and bring back Create PR bulk edits#112249
ryan953 wants to merge 1 commit intomasterfrom
ryan953/seer-autofix-bulk-agent-edit

Conversation

@ryan953
Copy link
Copy Markdown
Member

@ryan953 ryan953 commented Apr 3, 2026

SCR-20260403-oruo

@ryan953 ryan953 requested review from a team as code owners April 3, 2026 23:41
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 3, 2026
Copy link
Copy Markdown
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 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Bulk agent mutation applies to all projects, not selected
    • Filtered the projects array to only include selected projects (matching projectIds) before passing to bulkMutateSelectedAgent, consistent with the Create PRs dropdown pattern.

Create PR

Or push these changes by commenting:

@cursor push cbb2a94d34
Preview (cbb2a94d34)
diff --git a/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTableHeader.tsx b/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTableHeader.tsx
--- a/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTableHeader.tsx
+++ b/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTableHeader.tsx
@@ -148,7 +148,10 @@
                   key: typeof value === 'object' ? value.provider : value,
                   label,
                   onAction: () => {
-                    bulkMutateSelectedAgent(projects, value);
+                    const selectedProjects = projects.filter(project =>
+                      projectIds.includes(project.id)
+                    );
+                    bulkMutateSelectedAgent(selectedProjects, value);
                   },
                 })) ?? []
               }

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7a89eef. Configure here.

key: typeof value === 'object' ? value.provider : value,
label,
onAction: () => {
bulkMutateSelectedAgent(projects, value);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bulk agent mutation applies to all projects, not selected

High Severity

The bulkMutateSelectedAgent call passes the entire projects array (all projects in the table) instead of only the selected projects. The sibling "Create PRs" dropdown correctly uses projectIds (derived from selectedIds) to scope changes to the user's selection, but the "Agent" dropdown passes the unfiltered projects prop. This means selecting a few projects and choosing an agent will bulk-update every project in the table.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7a89eef. Configure here.

Comment on lines +150 to +152
onAction: () => {
bulkMutateSelectedAgent(projects, value);
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The Agent dropdown's onAction handler incorrectly passes all projects to bulkMutateSelectedAgent, ignoring the user's checkbox selections.
Severity: HIGH

Suggested Fix

Before calling bulkMutateSelectedAgent, filter the projects array to include only the projects whose IDs are present in the projectIds variable. This can be done by creating a new selectedProjects array. The call should then be updated to bulkMutateSelectedAgent(selectedProjects, value), mirroring the implementation used by the "Create PRs" dropdown.

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/projectTable/seerProjectTableHeader.tsx#L150-L152

Potential issue: In the `seerProjectTableHeader` component, the `Agent` dropdown's
`onAction` handler calls `bulkMutateSelectedAgent(projects, value)`. This passes the
entire `projects` prop, which includes all projects currently in the table view, to the
bulk mutation function. This ignores the user's specific checkbox selections, which are
available via the `selectedIds` context value. As a result, when a user selects a subset
of projects and attempts to change their assigned agent, the mutation is incorrectly
applied to all projects instead of just the selected ones.

Did we get this right? 👍 / 👎 to inform future reviews.

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