Onboarding detect provider from api key (#5955)

Co-authored-by: spencrmartin <spencermartin@squareup.com>
Co-authored-by: Michael Neale <michael.neale@gmail.com>
This commit is contained in:
Zane
2025-12-05 13:06:52 -08:00
committed by GitHub
parent 6fa3bd7e8a
commit 1db40709bb
18 changed files with 729 additions and 290 deletions
@@ -9,9 +9,14 @@ import { toastService } from '../../../toasts';
interface ProviderSettingsProps {
onClose: () => void;
isOnboarding: boolean;
onProviderLaunched?: () => void;
}
export default function ProviderSettings({ onClose, isOnboarding }: ProviderSettingsProps) {
export default function ProviderSettings({
onClose,
isOnboarding,
onProviderLaunched,
}: ProviderSettingsProps) {
const { getProviders } = useConfig();
const [loading, setLoading] = useState(true);
const [providers, setProviders] = useState<ProviderDetails[]>([]);
@@ -70,7 +75,11 @@ export default function ProviderSettings({ onClose, isOnboarding }: ProviderSett
msg: `Started goose with ${model} by ${provider.metadata.display_name}. You can change the model via the dropdown.`,
});
onClose();
if (onProviderLaunched) {
onProviderLaunched();
} else {
onClose();
}
} catch (error) {
console.error(`Failed to initialize with provider ${provider_name}:`, error);
@@ -83,7 +92,7 @@ export default function ProviderSettings({ onClose, isOnboarding }: ProviderSett
});
}
},
[onClose]
[onClose, onProviderLaunched]
);
return (