From 4ee3cc0c7f4c31f621984a813d4240316c8fabbc Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 9 Nov 2026 13:18:50 +0100 Subject: [PATCH] Runner: the line cap is read once in Start, not per line from a goroutine (issue 1966, review round 3) Claude-Session: https://claude.ai/code/session_01NcbgfFfQ4Z9UE5jK32PmE5 --- node-tools/internal/launch/launch.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/node-tools/internal/launch/launch.go b/node-tools/internal/launch/launch.go index dc64fdc..d293a19 100644 --- a/node-tools/internal/launch/launch.go +++ b/node-tools/internal/launch/launch.go @@ -301,6 +301,7 @@ func Start(module, entry string, env []string, mesh Bus, logf func(string, ...an // The restart pauses are read once, here: the exit handling runs on its own goroutine and must not // read the package's settings while a caller (a test) changes them (novox/hq issue 476). pauseFirst, pauseMost, settle := RestartFirst, RestartMost, RestartSettle + lineCap := maxLine pause := pauseFirst start := func() (*child, error) { @@ -348,12 +349,12 @@ func Start(module, entry string, env []string, mesh Bus, logf func(string, ...an defer close(c.handled) rd := bufio.NewReaderSize(stdout, 64*1024) for { - raw, tooLong, rerr := readCapped(rd, maxLine) + raw, tooLong, rerr := readCapped(rd, lineCap) if tooLong { // Never left frozen (issue 1966): a reader that stops while the bundle lives leaves the bundle's // next write blocked for good. Said, and the bundle ended; the exit path below fails what waits // on it and starts it again. - reason := fmt.Sprintf("%s's bundle wrote a line over %d bytes (a tool's answer the bus cannot carry)", module, maxLine) + reason := fmt.Sprintf("%s's bundle wrote a line over %d bytes (a tool's answer the bus cannot carry)", module, lineCap) logf("[mesh-tools] %s; ending the bundle", reason) c.mu.Lock() c.endedFor = reason