feat(gateway): collapse multi-tier failure details into short client message

Clients saw the full per-tier chain error including upstream HTML WAF
pages and JSON quota payloads. The response now carries one capped
one-line reason per tier (quota/cooling skips preserved); full detail
remains in rec.Err / stats API and is logged server-side.
This commit is contained in:
JianFeeeee
2026-08-24 16:02:31 +08:00
parent e19cff248f
commit 31b1ed2c96
2 changed files with 41 additions and 6 deletions

View File

@ -139,7 +139,7 @@ func TestChatAutoChain503Summary(t *testing.T) {
if rr.Code != http.StatusServiceUnavailable {
t.Fatalf("status=%d body=%s", rr.Code, rr.Body.String())
}
if !strings.Contains(rr.Body.String(), "all auto tiers failed") ||
if !strings.Contains(rr.Body.String(), "auto providers failed") ||
!strings.Contains(rr.Body.String(), "a/a-m") ||
!strings.Contains(rr.Body.String(), "b/b-m") {
t.Fatalf("503 must summarize every tier, body=%s", rr.Body.String())