fix(worker): increase SSE scanner buffer to 1MB in claudebox client
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
The HTTP claudebox client's ExecuteStream method used a bare bufio.NewScanner with the default 64KB max token size. When Claude Code produces tool results > 64KB (e.g., reading large files), the SSE event exceeds the scanner limit and fails with "token too long". Every other scanner in the codebase (claudecode adapter, claudebox executor, kubernetes executor) already uses scanner.Buffer(buf, 1MB). This was the only one missed. Fixes: "agent execution failed: read stream: bufio.Scanner: token too long" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f8554a5e6f
commit
3c9876a678
@ -175,6 +175,8 @@ func (c *Client) ExecuteStream(ctx context.Context, req *ExecuteRequest, handler
|
|||||||
|
|
||||||
// Parse SSE events
|
// Parse SSE events
|
||||||
scanner := bufio.NewScanner(resp.Body)
|
scanner := bufio.NewScanner(resp.Body)
|
||||||
|
buf := make([]byte, 0, 64*1024)
|
||||||
|
scanner.Buffer(buf, 1024*1024) // 1MB max to match other streaming paths
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := scanner.Text()
|
line := scanner.Text()
|
||||||
if !strings.HasPrefix(line, "data: ") {
|
if !strings.HasPrefix(line, "data: ") {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user