@@ -20,8 +20,8 @@ import {t, tct} from 'sentry/locale';
2020import type { Project } from 'sentry/types/project' ;
2121import { useQuery } from 'sentry/utils/queryClient' ;
2222import { useOrganization } from 'sentry/utils/useOrganization' ;
23+ import { useFetchAgentOptions } from 'sentry/views/settings/seer/overview/utils/seerPreferredAgent' ;
2324import {
24- useAgentOptions ,
2525 useMutateSelectedAgent ,
2626 useSelectedAgentFromProjectSettings ,
2727} from 'sentry/views/settings/seer/seerAgentHooks' ;
@@ -39,14 +39,11 @@ function AgentSpecificFields({
3939 integration,
4040 ...props
4141} : Props & {
42- integration : 'seer' | 'none' | CodingAgentIntegration ;
42+ integration : 'seer' | CodingAgentIntegration ;
4343} ) {
4444 if ( integration === 'seer' ) {
4545 return < SeerAgentSettings { ...props } /> ;
4646 }
47- if ( integration === 'none' ) {
48- return null ;
49- }
5047 if ( integration . provider === 'cursor' || integration . provider === 'claude_code' ) {
5148 return < CodingAgentSettings integration = { integration } { ...props } /> ;
5249 }
@@ -63,10 +60,9 @@ export function AutofixAgent({canWrite, preference, project}: Props) {
6360 ...organizationIntegrationsCodingAgents ( organization ) ,
6461 select : data => data . json . integrations ?? [ ] ,
6562 } ) ;
66- const options = useAgentOptions ( { integrations : integrations ?? [ ] } ) ;
63+ const options = useFetchAgentOptions ( { organization } ) ;
6764 const selected = useSelectedAgentFromProjectSettings ( {
6865 preference,
69- project,
7066 integrations : integrations ?? [ ] ,
7167 } ) ;
7268 const mutateSelectedAgent = useMutateSelectedAgent ( { project} ) ;
@@ -101,37 +97,29 @@ export function AutofixAgent({canWrite, preference, project}: Props) {
10197 ) ,
10298 }
10399 ) }
104- options = { options }
100+ options = { options . data ?? [ ] }
105101 value = { selected }
106- onChange = { ( integration : 'seer' | 'none' | CodingAgentIntegration ) => {
102+ onChange = { ( integration : 'seer' | CodingAgentIntegration ) => {
107103 mutateSelectedAgent ( integration , {
108104 onSuccess : ( ) =>
109105 addSuccessMessage (
110- integration === 'none'
111- ? t ( 'Removed coding agent' )
112- : tct ( 'Started using [name] as coding agent' , {
113- name : (
114- < strong >
115- { integration === 'seer'
116- ? t ( 'Seer Agent' )
117- : integration . name }
118- </ strong >
119- ) ,
120- } )
106+ tct ( 'Started using [name] as coding agent' , {
107+ name : (
108+ < strong >
109+ { integration === 'seer' ? t ( 'Seer Agent' ) : integration . name }
110+ </ strong >
111+ ) ,
112+ } )
121113 ) ,
122114 onError : ( ) =>
123115 addErrorMessage (
124- integration === 'none'
125- ? t ( 'Failed to update coding agent' )
126- : tct ( 'Failed to set [name] as coding agent' , {
127- name : (
128- < strong >
129- { integration === 'seer'
130- ? t ( 'Seer Agent' )
131- : integration . name }
132- </ strong >
133- ) ,
134- } )
116+ tct ( 'Failed to set [name] as coding agent' , {
117+ name : (
118+ < strong >
119+ { integration === 'seer' ? t ( 'Seer Agent' ) : integration . name }
120+ </ strong >
121+ ) ,
122+ } )
135123 ) ,
136124 } ) ;
137125 } }
0 commit comments