From c2a6ca8d3a237146449afdd97ac08e25cf377506 Mon Sep 17 00:00:00 2001 From: song Date: Fri, 9 Jan 2026 20:57:06 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=8F=90=E5=8D=87=20SSE=20=E5=8D=95?= =?UTF-8?q?=E8=A1=8C=E4=B8=8A=E9=99=90=E5=88=B0=2040MB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/config/config.go | 2 +- backend/internal/service/gateway_service.go | 2 +- config.yaml | 6 +++--- deploy/config.example.yaml | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/internal/config/config.go b/backend/internal/config/config.go index aaaaf3bd..d13a460a 100644 --- a/backend/internal/config/config.go +++ b/backend/internal/config/config.go @@ -544,7 +544,7 @@ func setDefaults() { viper.SetDefault("gateway.concurrency_slot_ttl_minutes", 30) // 并发槽位过期时间(支持超长请求) viper.SetDefault("gateway.stream_data_interval_timeout", 180) viper.SetDefault("gateway.stream_keepalive_interval", 10) - viper.SetDefault("gateway.max_line_size", 25*1024*1024) + viper.SetDefault("gateway.max_line_size", 40*1024*1024) viper.SetDefault("gateway.scheduling.sticky_session_max_waiting", 3) viper.SetDefault("gateway.scheduling.sticky_session_wait_timeout", 45*time.Second) viper.SetDefault("gateway.scheduling.fallback_wait_timeout", 30*time.Second) diff --git a/backend/internal/service/gateway_service.go b/backend/internal/service/gateway_service.go index 63245933..6da9b565 100644 --- a/backend/internal/service/gateway_service.go +++ b/backend/internal/service/gateway_service.go @@ -33,7 +33,7 @@ const ( claudeAPIURL = "https://api.anthropic.com/v1/messages?beta=true" claudeAPICountTokensURL = "https://api.anthropic.com/v1/messages/count_tokens?beta=true" stickySessionTTL = time.Hour // 粘性会话TTL - defaultMaxLineSize = 25 * 1024 * 1024 + defaultMaxLineSize = 40 * 1024 * 1024 claudeCodeSystemPrompt = "You are Claude Code, Anthropic's official CLI for Claude." maxCacheControlBlocks = 4 // Anthropic API 允许的最大 cache_control 块数量 ) diff --git a/config.yaml b/config.yaml index c282bf9a..54b591f3 100644 --- a/config.yaml +++ b/config.yaml @@ -154,9 +154,9 @@ gateway: # Stream keepalive interval (seconds), 0=disable # 流式 keepalive 间隔(秒),0=禁用 stream_keepalive_interval: 10 - # SSE max line size in bytes (default: 25MB) - # SSE 单行最大字节数(默认 25MB) - max_line_size: 26214400 + # SSE max line size in bytes (default: 40MB) + # SSE 单行最大字节数(默认 40MB) + max_line_size: 41943040 # Log upstream error response body summary (safe/truncated; does not log request content) # 记录上游错误响应体摘要(安全/截断;不记录请求内容) log_upstream_error_body: false diff --git a/deploy/config.example.yaml b/deploy/config.example.yaml index 40fab16e..60d79377 100644 --- a/deploy/config.example.yaml +++ b/deploy/config.example.yaml @@ -154,9 +154,9 @@ gateway: # Stream keepalive interval (seconds), 0=disable # 流式 keepalive 间隔(秒),0=禁用 stream_keepalive_interval: 10 - # SSE max line size in bytes (default: 25MB) - # SSE 单行最大字节数(默认 25MB) - max_line_size: 26214400 + # SSE max line size in bytes (default: 40MB) + # SSE 单行最大字节数(默认 40MB) + max_line_size: 41943040 # Log upstream error response body summary (safe/truncated; does not log request content) # 记录上游错误响应体摘要(安全/截断;不记录请求内容) log_upstream_error_body: false