Lifei/clean up old onboarding flow (#8099)

This commit is contained in:
Lifei Zhou
2026-03-26 11:34:22 +11:00
committed by GitHub
parent 8615853a89
commit d2553978c4
20 changed files with 10 additions and 1178 deletions
-3
View File
@@ -387,7 +387,6 @@ derive_utoipa!(Icon as IconSchema);
super::routes::status::diagnostics,
super::routes::mcp_ui_proxy::mcp_ui_proxy,
super::routes::config_management::backup_config,
super::routes::config_management::detect_provider,
super::routes::config_management::recover_config,
super::routes::config_management::validate_config,
super::routes::config_management::init_config,
@@ -484,8 +483,6 @@ derive_utoipa!(Icon as IconSchema);
components(schemas(
super::routes::config_management::UpsertConfigQuery,
super::routes::config_management::ConfigKeyQuery,
super::routes::config_management::DetectProviderRequest,
super::routes::config_management::DetectProviderResponse,
super::routes::config_management::ConfigResponse,
super::routes::config_management::ProvidersResponse,
super::routes::config_management::ProviderDetails,
@@ -12,7 +12,6 @@ use goose::config::paths::Paths;
use goose::config::ExtensionEntry;
use goose::config::{Config, ConfigError};
use goose::model::ModelConfig;
use goose::providers::auto_detect::detect_provider_from_api_key;
use goose::providers::base::{ProviderMetadata, ProviderType};
use goose::providers::canonical::maybe_get_canonical_model;
use goose::providers::catalog::{
@@ -149,16 +148,6 @@ pub struct SlashCommandsResponse {
pub commands: Vec<SlashCommand>,
}
#[derive(Deserialize, ToSchema)]
pub struct DetectProviderRequest {
pub api_key: String,
}
#[derive(Serialize, ToSchema)]
pub struct DetectProviderResponse {
pub provider_name: String,
pub models: Vec<String>,
}
#[utoipa::path(
post,
path = "/config/upsert",
@@ -534,31 +523,6 @@ pub async fn upsert_permissions(
Ok(Json("Permissions updated successfully".to_string()))
}
#[utoipa::path(
post,
path = "/config/detect-provider",
request_body = DetectProviderRequest,
responses(
(status = 200, description = "Provider detected successfully", body = DetectProviderResponse),
(status = 404, description = "No matching provider found"),
)
)]
pub async fn detect_provider(
Json(detect_request): Json<DetectProviderRequest>,
) -> Result<Json<DetectProviderResponse>, ErrorResponse> {
let api_key = detect_request.api_key.trim();
match detect_provider_from_api_key(api_key).await {
Some((provider_name, models)) => Ok(Json(DetectProviderResponse {
provider_name,
models,
})),
None => Err(ErrorResponse::not_found(
"Could not detect provider from the provided API key",
)),
}
}
#[utoipa::path(
post,
path = "/config/backup",
@@ -930,7 +894,6 @@ pub fn routes(state: Arc<AppState>) -> Router {
"/config/providers/{name}/cleanup",
post(cleanup_provider_cache),
)
.route("/config/detect-provider", post(detect_provider))
.route("/config/slash_commands", get(get_slash_commands))
.route(
"/config/canonical-model-info",