Skip to content

ref(seer): Remove duplicate useFetchAgentOptions, replaced by useCodingAgentSelectQueryOptions#113498

Merged
ryan953 merged 4 commits into
masterfrom
ryan953/ref-seer-utils
Apr 21, 2026
Merged

ref(seer): Remove duplicate useFetchAgentOptions, replaced by useCodingAgentSelectQueryOptions#113498
ryan953 merged 4 commits into
masterfrom
ryan953/ref-seer-utils

Conversation

@ryan953

@ryan953 ryan953 commented Apr 20, 2026

Copy link
Copy Markdown
Member

Quick swap of

- const agentOptions = useFetchAgentOptions({organization});
+ const agentOptions = useQuery(getCodingAgentSelectQueryOptions({organization}));

because we had duplicate utils going on

ryan953 and others added 4 commits April 20, 2026 15:25
Replace useFetchAgentOptions with the equivalent
useCodingAgentSelectOptions hook from sentry/utils/seer/preferredAgent,
consolidating coding agent option fetching into the shared module.

Co-Authored-By: Claude Sonnet 4 <noreply@example.com>
Made-with: Cursor
Same replacement as the header component — swap useFetchAgentOptions
for the shared useCodingAgentSelectOptions hook.

Co-Authored-By: Claude Sonnet 4 <noreply@example.com>
Made-with: Cursor
Update the agentOptions prop type to reference useCodingAgentSelectOptions
from the shared module instead of the old useFetchAgentOptions.

Co-Authored-By: Claude Sonnet 4 <noreply@example.com>
Made-with: Cursor
@ryan953
ryan953 requested review from a team as code owners April 20, 2026 22:36
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 20, 2026
Comment on lines +35 to 38
return queryOptions({
...organizationIntegrationsCodingAgents(organization),
select: (data): Array<{label: string; value: PreferredAgent}> => [
{value: 'seer', label: t('Seer Agent')},

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We're wrapping queryOptions() around an existing queryOptions, but when we wrap it we're also adding the select in there.

Types are properly being inherited through all this 👍

@ryan953
ryan953 requested a review from billyvg April 21, 2026 15:33
@ryan953
ryan953 merged commit a3f2cd1 into master Apr 21, 2026
67 checks passed
@ryan953
ryan953 deleted the ryan953/ref-seer-utils branch April 21, 2026 20:04
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants