From b2bc47abd7851fa8dcb121c638f0c4f37c4f064d Mon Sep 17 00:00:00 2001 From: erio Date: Mon, 9 Mar 2026 07:52:32 +0800 Subject: [PATCH] fix: increase SSE scanner max line size from 40MB to 500MB 4K image base64 data can exceed 40MB limit, causing "bufio.Scanner: token too long" errors. Scanner is adaptive (starts at 64KB, grows as needed), so increasing the cap has no impact on normal responses. --- backend/cmd/server/VERSION | 2 +- backend/internal/service/gateway_service.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/cmd/server/VERSION b/backend/cmd/server/VERSION index 7c415348a0..0cf91ff2a4 100644 --- a/backend/cmd/server/VERSION +++ b/backend/cmd/server/VERSION @@ -1 +1 @@ -0.1.93.25 +0.1.93.26 diff --git a/backend/internal/service/gateway_service.go b/backend/internal/service/gateway_service.go index c3a53e0f4b..2c5eb3d001 100644 --- a/backend/internal/service/gateway_service.go +++ b/backend/internal/service/gateway_service.go @@ -42,7 +42,7 @@ const ( claudeAPICountTokensURL = "https://api.anthropic.com/v1/messages/count_tokens?beta=true" stickySessionTTL = time.Hour // 粘性会话TTL ClientAffinityTTL = 24 * time.Hour // 客户端亲和TTL - defaultMaxLineSize = 40 * 1024 * 1024 + defaultMaxLineSize = 500 * 1024 * 1024 // Canonical Claude Code banner. Keep it EXACT (no trailing whitespace/newlines) // to match real Claude CLI traffic as closely as possible. When we need a visual // separator between system blocks, we add "\n\n" at concatenation time.