fix(goose): only send agent-session-id when a session exists (#6657)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Adrian Cole
2026-01-27 13:43:05 +09:00
committed by GitHub
parent 3dae12765f
commit f5b402bbdf
37 changed files with 398 additions and 383 deletions
@@ -28,7 +28,6 @@ use serde_json::Value;
use serde_yaml;
use std::{collections::HashMap, sync::Arc};
use utoipa::ToSchema;
use uuid::Uuid;
#[derive(Serialize, ToSchema)]
pub struct ExtensionResponse {
@@ -409,10 +408,8 @@ pub async fn get_provider_models(
.await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
// Config endpoints have no user session; use an ephemeral id for the probe.
let session_id = Uuid::new_v4().to_string();
let models_result = retry_operation(&RetryConfig::default(), || async {
provider.fetch_recommended_models(&session_id).await
provider.fetch_recommended_models().await
})
.await;
@@ -592,10 +589,8 @@ pub async fn detect_provider(
Json(detect_request): Json<DetectProviderRequest>,
) -> Result<Json<DetectProviderResponse>, StatusCode> {
let api_key = detect_request.api_key.trim();
// Provider detection runs without a user session; use an ephemeral id.
let session_id = Uuid::new_v4().to_string();
match detect_provider_from_api_key(&session_id, api_key).await {
match detect_provider_from_api_key(api_key).await {
Some((provider_name, models)) => Ok(Json(DetectProviderResponse {
provider_name,
models,