RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
fix(api): return nonempty string response messages (#21194)
adws232b3f7721f2
diff --git a/docs/references/http_api_reference.md b/docs/references/http_api_reference.mdindex 7ef2186778..151cc03207 100644--- a/docs/references/http_api_reference.md+++ b/docs/references/http_api_reference.md@@ -9,6 +9,8 @@ sidebar_custom_props: {A complete reference for RAGFlow's RESTful API, including migration notes for the 1.0 Go backend. Before proceeding, please ensure you [have your RAGFlow API key ready for authentication](https://ragflow.io/docs/dev/acquire_ragflow_api_key).+In the standard response envelope, `message` is always a non-empty string. Successful responses default to `"success"`; error responses contain a description of the error.+---## ERROR CODES@@ -3925,7 +3927,7 @@ Success without `chat_id` or `session_id`:```jsondata:{"code": 0,- "message": "",+ "message": "success","data": {"answer": "I am an assistant powered by the tenant's default chat model.","reference": {},@@ -3936,7 +3938,7 @@ data:{}data:{"code": 0,- "message": "",+ "message": "success","data": true}```@@ -3948,7 +3950,7 @@ Streaming response example with `chat_id` and `session_id`:```jsondata:{"code": 0,- "message": "",+ "message": "success","data": {"answer": "","reference": {@@ -3966,7 +3968,7 @@ data:{}data:{"code": 0,- "message": "",+ "message": "success","data": {"answer": "The user just said \"hello\". I should respond warmly and ask how I can help.","reference": {@@ -3983,7 +3985,7 @@ data:{}data:{"code": 0,- "message": "",+ "message": "success","data": {"answer": " Let's keep it short and friendly.","reference": {@@ -4000,7 +4002,7 @@ data:{}data:{"code": 0,- "message": "",+ "message": "success","data": {"answer": "","reference": {@@ -4018,7 +4020,7 @@ data:{}data:{"code": 0,- "message": "",+ "message": "success","data": {"answer": "Hello! π Welcome!","reference": {@@ -4035,7 +4037,7 @@ data:{}data:{"code": 0,- "message": "",+ "message": "success","data": true}```@@ -4045,7 +4047,7 @@ For `legacy: true`, the same request keeps the thinking content inside `answer````jsondata:{"code": 0,- "message": "",+ "message": "success","data": {"answer": "<think>The user just said \"hello\".","reference": {@@ -4062,7 +4064,7 @@ data:{}data:{"code": 0,- "message": "",+ "message": "success","data": {"answer": "<think>The user just said \"hello\". I should respond warmly and ask how I can help.","reference": {@@ -4079,7 +4081,7 @@ data:{}data:{"code": 0,- "message": "",+ "message": "success","data": {"answer": "<think>The user just said \"hello\". I should respond warmly and ask how I can help. Let's keep it short and friendly.</think>Hello! π Welcome!","reference": {@@ -4096,7 +4098,7 @@ data:{}data:{"code": 0,- "message": "",+ "message": "success","data": true}```@@ -5577,7 +5579,7 @@ Success:"data": {...your new memory here},- "message": true+ "message": "success"}```@@ -5703,7 +5705,7 @@ Success:"data": {...your updated memory here},- "message": true+ "message": "success"}```@@ -5801,7 +5803,7 @@ Success:],"total_count": 4},- "message": true+ "message": "success"}```@@ -5877,7 +5879,7 @@ Success"update_time": null,"user_prompt": null},- "message": true+ "message": "success"}```@@ -5929,7 +5931,7 @@ Success{"code": 0,"data": null,- "message": true+ "message": "success"}```@@ -5939,7 +5941,7 @@ Failure{"code": 404,"data": null,- "message": true+ "message": "Resource not found"}```@@ -6058,7 +6060,7 @@ Success},"storage_type": "table"},- "message": true+ "message": "success"}```@@ -6201,7 +6203,7 @@ Success{"code": 0,"data": null,- "message": true+ "message": "success"}```@@ -6266,7 +6268,7 @@ Success{"code": 0,"data": null,- "message": true+ "message": "success"}```@@ -6363,7 +6365,7 @@ Success},...other 2 matched messages here],- "message": true+ "message": "success"}```@@ -6441,7 +6443,7 @@ Success},...other 9 messages here],- "message": true+ "message": "success"}```@@ -6514,7 +6516,7 @@ Success"valid_at": "2026-01-07 16:48:37","zone_id": 0},- "message": true+ "message": "success"}```@@ -8303,9 +8305,9 @@ curl --request POST \Success (streaming):```text-data: {"code": 0, "message": "", "data": {"answer": "...", "reference": {...}}}+data: {"code": 0, "message": "success", "data": {"answer": "...", "reference": {...}}}-data: {"code": 0, "message": "", "data": true}+data: {"code": 0, "message": "success", "data": true}```Failure:diff --git a/internal/admin/handler.go b/internal/admin/handler.goindex f169883316..31308102ee 100644--- a/internal/admin/handler.go+++ b/internal/admin/handler.go@@ -60,15 +60,9 @@ type ErrorResponse struct {func (h *Handler) Healthz(c *gin.Context) {result, allOK := service.GetComponentsHealthz(c.Request.Context())if allOK {- c.JSON(http.StatusOK, gin.H{- "code": 0,- "data": result,- })+ common.SuccessWithData(c, result, "success")} else {- c.JSON(http.StatusInternalServerError, gin.H{- "code": common.CodeServerError,- "data": result,- })+ common.ResponseWithHttpCodeData(c, http.StatusInternalServerError, common.CodeServerError, result, "")}}@@ -1244,7 +1238,7 @@ func (h *Handler) PingStore(c *gin.Context) {ctx := c.Request.Context()if storageImpl.Health(ctx) {- common.SuccessNoMessage(c, "SUCCESS")+ common.SuccessWithData(c, "SUCCESS", "success")} else {common.ErrorWithCode(c, common.CodeServerError, "storage health check failed")}@@ -1254,7 +1248,7 @@ func (h *Handler) PingCache(c *gin.Context) {ctx := c.Request.Context()redisClient := kvrocks.Get()if redisClient.Health(ctx) {- common.SuccessNoMessage(c, "SUCCESS")+ common.SuccessWithData(c, "SUCCESS", "success")} else {common.ErrorWithCode(c, common.CodeServerError, "cache health check failed")}@@ -1275,7 +1269,7 @@ func (h *Handler) PingEngine(c *gin.Context) {return}- common.SuccessNoMessage(c, "SUCCESS")+ common.SuccessWithData(c, "SUCCESS", "success")}func (h *Handler) GetHardwareInfo(c *gin.Context) {diff --git a/internal/admin/handler_ee.go b/internal/admin/handler_ee.goindex 9c1d96ce3b..90a110f757 100644--- a/internal/admin/handler_ee.go+++ b/internal/admin/handler_ee.go@@ -837,7 +837,7 @@ func (h *Handler) ShowSystemLicense(c *gin.Context) {return}}- common.SuccessNoMessage(c, result)+ common.SuccessWithData(c, result, "success")}type SetSystemLicenseConfigRequest struct {diff --git a/internal/cli/response.go b/internal/cli/response.goindex 3b9c5372bd..8a5816d7bb 100644--- a/internal/cli/response.go+++ b/internal/cli/response.go@@ -1281,7 +1281,7 @@ func (r *QuotaSummaryResponse) PrintOut() {//// JSON shape://-// {"code":0,"data":{"answer":"...","reference":...},"message":""}+// {"code":0,"data":{"answer":"...","reference":...},"message":"success"}type ChatCompletionsResponse struct {Code int `json:"code"`Data *chatCompletionData `json:"data"`diff --git a/internal/common/http.go b/internal/common/http.goindex d5782100d3..4ac97f1b8d 100644--- a/internal/common/http.go+++ b/internal/common/http.go@@ -671,49 +671,51 @@ func allZero(b []byte) bool {type response struct {Code ErrorCode `json:"code"`Data interface{} `json:"data"`- Message interface{} `json:"message"`+ Message string `json:"message"`Total interface{} `json:"total,omitempty"`}// errorResponse error responsetype errorResponse struct {- Code ErrorCode `json:"code"`- Message interface{} `json:"message"`+ Code ErrorCode `json:"code"`+ Message string `json:"message"`+}++func responseMessage(code ErrorCode, message string) string {+ if message != "" {+ return message+ }+ if code == CodeSuccess {+ return "success"+ }+ return code.Message()}// SuccessWithData returns success response with data-func SuccessWithData(c *gin.Context, data interface{}, message interface{}) {+func SuccessWithData(c *gin.Context, data interface{}, message string) {c.JSON(http.StatusOK, response{Code: CodeSuccess,Data: data,- Message: message,+ Message: responseMessage(CodeSuccess, message),})}// SuccessWithDataAndTotal returns success response with data and total number-func SuccessWithDataAndTotal(c *gin.Context, data, total, message interface{}) {+func SuccessWithDataAndTotal(c *gin.Context, data, total interface{}, message string) {c.JSON(http.StatusOK, response{Code: CodeSuccess,Data: data,Total: total,- Message: message,- })-}--// SuccessNoMessage returns success response without message-func SuccessNoMessage(c *gin.Context, data interface{}) {- c.JSON(http.StatusOK, response{- Code: CodeSuccess,- Data: data,+ Message: responseMessage(CodeSuccess, message),})}// SuccessNoData returns success response without data-func SuccessNoData(c *gin.Context, message interface{}) {+func SuccessNoData(c *gin.Context, message string) {c.JSON(http.StatusOK, response{Code: CodeSuccess,Data: nil,- Message: message,+ Message: responseMessage(CodeSuccess, message),})}@@ -721,7 +723,7 @@ func SuccessNoData(c *gin.Context, message interface{}) {func SuccessWithMessage(c *gin.Context, message string) {c.JSON(http.StatusOK, response{Code: CodeSuccess,- Message: message,+ Message: responseMessage(CodeSuccess, message),})}@@ -729,7 +731,7 @@ func SuccessWithMessage(c *gin.Context, message string) {func ErrorWithCode(c *gin.Context, code ErrorCode, message string) {c.JSON(http.StatusOK, errorResponse{Code: code,- Message: message,+ Message: responseMessage(code, message),})}@@ -737,7 +739,7 @@ func ResponseWithCodeData(c *gin.Context, code ErrorCode, data interface{}, messc.JSON(http.StatusOK, response{Code: code,Data: data,- Message: message,+ Message: responseMessage(code, message),})}@@ -745,7 +747,7 @@ func ResponseWithHttpCodeData(c *gin.Context, httpCode int, code ErrorCode, datac.JSON(httpCode, response{Code: code,Data: data,- Message: message,+ Message: responseMessage(code, message),})}diff --git a/internal/handler/dataset.go b/internal/handler/dataset.goindex 0b24593664..ec2159fae5 100644--- a/internal/handler/dataset.go+++ b/internal/handler/dataset.go@@ -79,7 +79,7 @@ func (h *DatasetsHandler) ListDatasets(c *gin.Context) {common.ErrorWithCode(c, code, err.Error())return}- common.SuccessNoMessage(c, data)+ common.SuccessWithData(c, data, "success")return}@@ -224,6 +224,7 @@ func (h *DatasetsHandler) ListDatasets(c *gin.Context) {c.JSON(http.StatusOK, gin.H{"code": common.CodeSuccess,"data": data,+ "message": "success","total_datasets": total,})}@@ -276,7 +277,7 @@ func (h *DatasetsHandler) CreateDataset(c *gin.Context) {return}- common.SuccessNoMessage(c, result)+ common.SuccessWithData(c, result, "success")}// GetDataset handles GET /api/v1/datasets/:dataset_id.@@ -296,7 +297,7 @@ func (h *DatasetsHandler) GetDataset(c *gin.Context) {return}- common.SuccessNoMessage(c, result)+ common.SuccessWithData(c, result, "success")}// UpdateDataset Update a dataset.@@ -467,7 +468,7 @@ func (h *DatasetsHandler) UpdateDataset(c *gin.Context) {return}- common.SuccessNoMessage(c, result)+ common.SuccessWithData(c, result, "success")}func (h *DatasetsHandler) GetMetadataConfig(c *gin.Context) {@@ -486,7 +487,7 @@ func (h *DatasetsHandler) GetMetadataConfig(c *gin.Context) {return}- common.SuccessNoMessage(c, result)+ common.SuccessWithData(c, result, "success")}func (h *DatasetsHandler) UpdateMetadataConfig(c *gin.Context) {@@ -511,7 +512,7 @@ func (h *DatasetsHandler) UpdateMetadataConfig(c *gin.Context) {return}- common.SuccessNoMessage(c, result)+ common.SuccessWithData(c, result, "success")}// GetIngestionSummary handles GET /api/v1/datasets/:dataset_id/ingestions/summary.@@ -731,7 +732,7 @@ func (h *DatasetsHandler) DeleteDatasets(c *gin.Context) {return}- common.SuccessNoMessage(c, result)+ common.SuccessWithData(c, result, "success")}// GetKnowledgeGraph handles GET /api/v1/datasets/:dataset_id/graph.@@ -1163,7 +1164,7 @@ func (h *DatasetsHandler) SearchDatasets(c *gin.Context) {return}- common.SuccessNoMessage(c, resp)+ common.SuccessWithData(c, resp, "success")}// SearchDataset searches chunks within a single dataset based on a question.@@ -1222,7 +1223,7 @@ func (h *DatasetsHandler) SearchDataset(c *gin.Context) {return}- common.SuccessNoMessage(c, resp)+ common.SuccessWithData(c, resp, "success")}func validateSearchDatasetsRequest(req *service.SearchDatasetsRequest) error {diff --git a/internal/handler/dify_retrieval_handler.go b/internal/handler/dify_retrieval_handler.goindex 6e826ee0e0..cc6b2b29f1 100644--- a/internal/handler/dify_retrieval_handler.go+++ b/internal/handler/dify_retrieval_handler.go@@ -393,5 +393,5 @@ func (h *DifyRetrievalHandler) Retrieval(c *gin.Context) {// HealthCheck Health check returns a simple health check response.func (h *DifyRetrievalHandler) HealthCheck(c *gin.Context) {- common.SuccessNoMessage(c, true)+ common.SuccessWithData(c, true, "success")}diff --git a/internal/handler/document.go b/internal/handler/document.goindex ae8355d3d4..105d486bf5 100644--- a/internal/handler/document.go+++ b/internal/handler/document.go@@ -1072,7 +1072,7 @@ func (h *DocumentHandler) uploadLocalDocuments(c *gin.Context, kb *entity.Knowlecommon.ResponseWithCodeData(c, common.CodeServerError, data, strings.Join(errMsgs, "\n"))return}- common.SuccessNoMessage(c, data)+ common.SuccessWithData(c, data, "success")return}mapped := make([]map[string]interface{}, len(data))@@ -1083,7 +1083,7 @@ func (h *DocumentHandler) uploadLocalDocuments(c *gin.Context, kb *entity.Knowlecommon.ResponseWithCodeData(c, common.CodeServerError, mapped, strings.Join(errMsgs, "\n"))return}- common.SuccessNoMessage(c, mapped)+ common.SuccessWithData(c, mapped, "success")}func (h *DocumentHandler) uploadEmptyDocument(c *gin.Context, kb *entity.Knowledgebase, tenantID string) {@@ -1112,7 +1112,7 @@ func (h *DocumentHandler) uploadEmptyDocument(c *gin.Context, kb *entity.Knowledcommon.ErrorWithCode(c, code, err.Error())return}- common.SuccessNoMessage(c, mapDocKeysWithRunStatus(data))+ common.SuccessWithData(c, mapDocKeysWithRunStatus(data), "success")}func (h *DocumentHandler) uploadWebDocument(c *gin.Context, kb *entity.Knowledgebase, tenantID string) {@@ -1140,7 +1140,7 @@ func (h *DocumentHandler) uploadWebDocument(c *gin.Context, kb *entity.Knowledgecommon.ErrorWithCode(c, code, err.Error())return}- common.SuccessNoMessage(c, mapDocKeysWithRunStatus(data))+ common.SuccessWithData(c, mapDocKeysWithRunStatus(data), "success")}// mapDocKeysWithRunStatus renames a freshly-created document's raw keys to the@@ -1651,7 +1651,7 @@ func (h *DocumentHandler) UpdateDatasetDocument(c *gin.Context) {return}- common.SuccessNoMessage(c, data)+ common.SuccessWithData(c, data, "success")}func (h *DocumentHandler) UploadInfo(c *gin.Context) {diff --git a/internal/handler/memory.go b/internal/handler/memory.goindex 733bf2cb26..bcb32ed21f 100644--- a/internal/handler/memory.go+++ b/internal/handler/memory.go@@ -73,7 +73,7 @@ func NewMemoryHandler(memoryService *service.MemoryService) *MemoryHandler {//// Response Format:// - code: Status code (0=success, other=error)-// - message: true on success, error message on failure+// - message: "success" on success, error message on failure// - data: Memory object on success//// Business Logic (matching Python create_memory):@@ -333,7 +333,7 @@ func splitQueryValues(c *gin.Context, key string) []string {//// Response Format:// - code: Status code-// - message: true+// - message: "success"// - data.memory_list: Array of Memory objects// - data.total_count: Total record countfunc (h *MemoryHandler) ListMemories(c *gin.Context) {@@ -405,7 +405,7 @@ func (h *MemoryHandler) ListMemories(c *gin.Context) {//// Response Format:// - code: Status code-// - message: true+// - message: "success"// - data: Memory object, including owner_name fieldfunc (h *MemoryHandler) GetMemoryConfig(c *gin.Context) {// Get memory_id from URL path@@ -461,7 +461,7 @@ func (h *MemoryHandler) GetMemoryConfig(c *gin.Context) {//// Response Format:// - code: Status code-// - message: true+// - message: "success"// - data.messages: Array of message objects// - data.storage_type: Storage typefunc (h *MemoryHandler) GetMemoryMessages(c *gin.Context) {@@ -514,7 +514,7 @@ func (h *MemoryHandler) GetMemoryMessages(c *gin.Context) {return}- common.SuccessWithData(c, data, true)+ common.SuccessWithData(c, data, "success")}type messageMemoryIDs []string@@ -649,7 +649,7 @@ func (h *MemoryHandler) ForgetMessage(c *gin.Context) {return}- common.SuccessNoData(c, true)+ common.SuccessNoData(c, "success")}func isMemoryServiceNotFound(err error) bool {@@ -738,7 +738,7 @@ func (h *MemoryHandler) UpdateMessage(c *gin.Context) {return}- common.SuccessNoData(c, true)+ common.SuccessNoData(c, "success")}// GetMessageContent handles GET request for getting message content@@ -785,7 +785,7 @@ func (h *MemoryHandler) GetMessageContent(c *gin.Context) {return}- common.SuccessWithData(c, data, true)+ common.SuccessWithData(c, data, "success")}// SearchMessage handles GET request for searching messages@@ -853,7 +853,7 @@ func (h *MemoryHandler) SearchMessage(c *gin.Context) {return}- common.SuccessWithData(c, res, true)+ common.SuccessWithData(c, res, "success")}// GetMessages handles GET request for getting message list@@ -901,7 +901,7 @@ func (h *MemoryHandler) GetMessages(c *gin.Context) {return}- common.SuccessWithData(c, data, true)+ common.SuccessWithData(c, data, "success")}// isArgumentError determines if an error message is an argument errordiff --git a/internal/handler/search.go b/internal/handler/search.goindex bb503bac78..72d40a7998 100644--- a/internal/handler/search.go+++ b/internal/handler/search.go@@ -447,6 +447,6 @@ func (h *SearchHandler) Completion(c *gin.Context) {}}if !hadError {- writer.Write(c, "data: {\"code\": 0, \"message\": \"\", \"data\": true}\n\n")+ writer.Write(c, "data: {\"code\": 0, \"message\": \"success\", \"data\": true}\n\n")}}diff --git a/internal/handler/searchbot.go b/internal/handler/searchbot.goindex 8d8ff45eb0..6a06c27e94 100644--- a/internal/handler/searchbot.go+++ b/internal/handler/searchbot.go@@ -328,7 +328,7 @@ func (h *SearchBotHandler) Ask(c *gin.Context) {}}c.Stream(func(w io.Writer) bool {- fmt.Fprintf(w, "data: {\"code\": 0, \"message\": \"\", \"data\": true}\n\n")+ fmt.Fprintf(w, "data: {\"code\": 0, \"message\": \"success\", \"data\": true}\n\n")return false})@@ -476,7 +476,7 @@ func sseAnswer(answer string, refs interface{}, final bool) string {}payload := ssePayload{Code: 0,- Message: "",+ Message: "success",Data: askSSEData{Answer: answer,Reference: refs,@@ -516,7 +516,7 @@ func sseMarker(marker string) string {} else {d.EndToThink = true}- payload := ssePayload{Code: 0, Message: "", Data: d}+ payload := ssePayload{Code: 0, Message: "success", Data: d}b, _ := json.Marshal(payload)return fmt.Sprintf("data: %s\n\n", string(b))}diff --git a/internal/service/bot_completion.go b/internal/service/bot_completion.goindex 61897216f2..a686111c23 100644--- a/internal/service/bot_completion.go+++ b/internal/service/bot_completion.go@@ -14,19 +14,15 @@// limitations under the License.//-// bot_completion.go is the SSE envelope writer + ChatbotCompletion-// service path for /api/v1/chatbots/<dialog_id>/completions. The wire-// shape is dictated by the existing python-// `api/db/services/conversation_service.py::async_iframe_completion`-// β JS widgets reading the iframe SDK expect this exact envelope, so-// any change to the frame keys is a wire-contract change.+// bot_completion.go contains the SSE envelope writer and ChatbotCompletion+// service path for /api/v1/chatbots/<dialog_id>/completions.//// Frame shape (one JSON object per `data:` line)://-// {"code":0,"message":"","data":{"answer":"...","reference":{...},+// {"code":0,"message":"success","data":{"answer":"...","reference":{...},// "audio_binary":null,"id":"...","session_id":"..."}, ...}//-// The final completion marker is `data: {"code":0,"message":"",+// The final completion marker is `data: {"code":0,"message":"success",// "data":true}` followed by the OpenAI-style `data: [DONE]` line// that the existing Go SSE writers emit on the production// /agents/chat/completions path.@@ -84,10 +80,8 @@ type ChatbotSSEFrame struct {EndToThink bool `json:"-"`}-// WriteChatbotFrame emits one python-style SSE frame and flushes the-// underlying http.ResponseWriter. The frame is `data: <json>\n\n`-// and is byte-equivalent to the python side so the iframe SDK and-// existing JS widgets keep working.+// WriteChatbotFrame emits one SSE frame and flushes the underlying+// http.ResponseWriter. The frame is `data: <json>\n\n`.//// Error frames sanitize the message β internal errors (gorm stack// frames, SQL details, storage paths) MUST NOT be echoed to the@@ -135,7 +129,7 @@ func WriteChatbotFrame(w http.ResponseWriter, f ChatbotSSEFrame) error {}payload = map[string]any{"code": 0,- "message": "",+ "message": "success","data": data,}}@@ -161,12 +155,12 @@ func WriteChatbotFrame(w http.ResponseWriter, f ChatbotSSEFrame) error {return nil}-// WriteDoneFrame emits the python completion marker-// `data: {"code":0,"message":"","data":true}\n\n` followed by the+// WriteDoneFrame emits the completion marker+// `data: {"code":0,"message":"success","data":true}\n\n` followed by the// OpenAI-style `data: [DONE]\n\n` terminator. Used by both bot// completion paths.func WriteDoneFrame(w http.ResponseWriter) error {- if _, err := w.Write([]byte(`data: {"code":0,"message":"","data":true}` + "\n\n")); err != nil {+ if _, err := w.Write([]byte(`data: {"code":0,"message":"success","data":true}` + "\n\n")); err != nil {return err}if _, err := w.Write([]byte("data: [DONE]\n\n")); err != nil {diff --git a/internal/service/chat_session.go b/internal/service/chat_session.goindex fef9d0d494..4021d70db5 100644--- a/internal/service/chat_session.go+++ b/internal/service/chat_session.go@@ -1442,11 +1442,11 @@ func (s *ChatSessionService) ChatCompletions(finalLegacyAnswer["answer"] = fullAnswer.String()delete(finalLegacyAnswer, "start_to_think")delete(finalLegacyAnswer, "end_to_think")- finalChunk := sseWrapper{Code: 0, Message: "", Data: sanitizeJSONFloats(finalLegacyAnswer)}+ finalChunk := sseWrapper{Code: 0, Message: "success", Data: sanitizeJSONFloats(finalLegacyAnswer)}sendOrCancel(fmt.Sprintf("data:%s\n\n", marshalJSONWithSpaces(finalChunk)))}- wrapper := sseWrapper{Code: 0, Message: "", Data: true}+ wrapper := sseWrapper{Code: 0, Message: "success", Data: true}sendOrCancel(fmt.Sprintf("data:%s\n\n", marshalJSONWithSpaces(wrapper)))} else {ans := accumulateNonStreamAnswer(resultChan)@@ -1793,9 +1793,9 @@ type sseAnswerChunk struct {ThinkEvent interface{} `json:"think_event,omitempty"`}-// sseWrapper wraps the SSE response with deterministic field order matching Python:+// sseWrapper wraps the SSE response with deterministic field order://-// {"code": 0, "message": "", "data": ...}+// {"code": 0, "message": "success", "data": ...}type sseWrapper struct {Code int `json:"code"`Message string `json:"message"`@@ -1915,7 +1915,7 @@ func sseMarshalChunk(ans map[string]interface{}, chatID string) string {EndToThink: endToThink,ThinkEvent: ans["think_event"],}- wrapper := sseWrapper{Code: 0, Message: "", Data: chunk}+ wrapper := sseWrapper{Code: 0, Message: "success", Data: chunk}return marshalJSONWithSpaces(wrapper)}