From 0c162d6b906694c1d9727181f2ba3bbc90615f65 Mon Sep 17 00:00:00 2001 From: AnUnknownNumber23 <2822814533@qq.com> Date: Wed, 15 Jul 2026 01:46:02 +0800 Subject: [PATCH] fix: resolve stream 500, restore back button, fix stale connection_url - Remove ServerHttpResponse parameter from GraphController to fix No primary constructor found error in Spring MVC mode - Restore back button in ChatSessionSidebar and add missing ArrowLeft icon import - Fix resolveConnectionUrl() ignoring updated host/port/database when a legacy connection_url is present in the database Co-Authored-By: Claude Fable 5 --- .gitignore | 1 + .../dataagent/controller/GraphController.java | 22 +------------------ .../handler/DatasourceTypeHandler.java | 3 +++ 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index b41f9d582..fec652f2a 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,4 @@ uploads/* spring-ai-alibaba-1.1.0.0/ .gstack/ .codegraph/ +*/vectorstore/vectorstore.json diff --git a/data-agent-management/src/main/java/com/alibaba/cloud/ai/dataagent/controller/GraphController.java b/data-agent-management/src/main/java/com/alibaba/cloud/ai/dataagent/controller/GraphController.java index 459d5cd40..c6d3cbf8f 100644 --- a/data-agent-management/src/main/java/com/alibaba/cloud/ai/dataagent/controller/GraphController.java +++ b/data-agent-management/src/main/java/com/alibaba/cloud/ai/dataagent/controller/GraphController.java @@ -1,18 +1,3 @@ -/* - * Copyright 2024-2026 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package com.alibaba.cloud.ai.dataagent.controller; import com.alibaba.cloud.ai.dataagent.dto.GraphRequest; @@ -24,7 +9,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.http.codec.ServerSentEvent; -import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Flux; @@ -53,11 +37,7 @@ public Flux> streamSearch(@RequestParam("agen @RequestParam(value = "humanFeedback", required = false) boolean humanFeedback, @RequestParam(value = "humanFeedbackContent", required = false) String humanFeedbackContent, @RequestParam(value = "rejectedPlan", required = false) boolean rejectedPlan, - @RequestParam(value = "nl2sqlOnly", required = false) boolean nl2sqlOnly, ServerHttpResponse response) { - // Set SSE-related HTTP headers - response.getHeaders().add("Cache-Control", "no-cache"); - response.getHeaders().add("Connection", "keep-alive"); - response.getHeaders().add("Access-Control-Allow-Origin", "*"); + @RequestParam(value = "nl2sqlOnly", required = false) boolean nl2sqlOnly) { Sinks.Many> sink = Sinks.many().unicast().onBackpressureBuffer(); diff --git a/data-agent-management/src/main/java/com/alibaba/cloud/ai/dataagent/service/datasource/handler/DatasourceTypeHandler.java b/data-agent-management/src/main/java/com/alibaba/cloud/ai/dataagent/service/datasource/handler/DatasourceTypeHandler.java index a134a7d92..3c350fc2a 100644 --- a/data-agent-management/src/main/java/com/alibaba/cloud/ai/dataagent/service/datasource/handler/DatasourceTypeHandler.java +++ b/data-agent-management/src/main/java/com/alibaba/cloud/ai/dataagent/service/datasource/handler/DatasourceTypeHandler.java @@ -45,6 +45,9 @@ default String buildConnectionUrl(Datasource datasource) { } default String resolveConnectionUrl(Datasource datasource) { + if (hasRequiredConnectionFields(datasource)) { + return buildConnectionUrl(datasource); + } String existing = datasource.getConnectionUrl(); if (StringUtils.hasText(existing)) { return existing;