From b47f8df3b0a52f0375b5e884a13cf43785ec6500 Mon Sep 17 00:00:00 2001 From: temp Date: Mon, 24 Aug 2026 14:48:37 +0800 Subject: [PATCH] fix: avoid inferred retry failure reason --- internal/multiagent/eino_run_error_handler.go | 3 +-- internal/multiagent/eino_run_error_handler_test.go | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/multiagent/eino_run_error_handler.go b/internal/multiagent/eino_run_error_handler.go index 606196b9..7e26c077 100644 --- a/internal/multiagent/eino_run_error_handler.go +++ b/internal/multiagent/eino_run_error_handler.go @@ -143,8 +143,7 @@ func einoUserFacingRunError(err error) einoRunUserError { } out.rawLastError = strings.TrimSpace(lastErr.Error()) if isEinoShouldRetryOutputRejected(lastErr) { - out.kind = "empty_model_output" - out.summary = "模型输出被重试策略拒绝;常见原因是空内容或缺少有效输出。" + out.kind = "model_output_rejected" out.message = formatEinoRetryExhaustedMessage(out.rawLastError, retryErr.TotalRetries) return out } diff --git a/internal/multiagent/eino_run_error_handler_test.go b/internal/multiagent/eino_run_error_handler_test.go index b1d374c1..fd200777 100644 --- a/internal/multiagent/eino_run_error_handler_test.go +++ b/internal/multiagent/eino_run_error_handler_test.go @@ -87,11 +87,11 @@ func TestEinoRunErrorHandlerRetryExhaustedEmptyOutputProgress(t *testing.T) { !strings.Contains(message, "model output rejected by ShouldRetry at attempt 5") { t.Fatalf("message = %q", message) } - if data["errorKind"] != "empty_model_output" { + if data["errorKind"] != "model_output_rejected" { t.Fatalf("errorKind = %#v", data["errorKind"]) } - if data["errorSummary"] != "模型输出被重试策略拒绝;常见原因是空内容或缺少有效输出。" { - t.Fatalf("errorSummary = %#v", data["errorSummary"]) + if _, ok := data["errorSummary"]; ok { + t.Fatalf("errorSummary should not infer a reason, got %#v", data["errorSummary"]) } if data["retryExhausted"] != true || data["totalRetries"] != 4 { t.Fatalf("retry metadata = %#v", data)