Add custom gateway selection to TUI sign-in (#60009)

## What changed

- Add the disabled-by-default `gateway_setup_wizard` feature to let users choose a saved custom gateway during eligible local sign-in onboarding.
- Save the selection as `model_provider`, restart the embedded app server with that provider, and complete required primary authentication and gateway OAuth before starting the first chat.
- Show gateway loading and configuration errors, browser sign-in links, and an OAuth retry action. Respect provider policy and launch overrides.

## Testing

Add coverage for onboarding eligibility, saved gateway selection and persistence, and gateway error and OAuth screens. Add a terminal integration test verifying that the selected gateway receives the first chat with authentication.

GitOrigin-RevId: 92bd2da3abd28d6c2274c91b2d7561bf359f0ca0
This commit is contained in:
alexsong-oai
2026-11-06 23:35:54 +00:00
committed by copyberry
parent 0389e80f07
commit 2497eab251
24 changed files with 1034 additions and 148 deletions
+8
View File
@@ -477,6 +477,8 @@ pub enum Feature {
BedrockSetupWizard,
/// Offer Google Cloud Vertex AI setup during TUI sign-in onboarding.
GcpSetupWizard,
/// Offer custom gateway setup during TUI sign-in onboarding.
GatewaySetupWizard,
/// Removed compatibility flag retained as a no-op.
Personality,
/// Enable native artifact tools.
@@ -2262,6 +2264,12 @@ pub const FEATURES: &[FeatureSpec] = &[
stage: Stage::Stable,
default_enabled: false,
},
FeatureSpec {
id: Feature::GatewaySetupWizard,
key: "gateway_setup_wizard",
stage: Stage::Stable,
default_enabled: false,
},
FeatureSpec {
id: Feature::Personality,
key: "personality",