ScuttleBot

fix: tailSessionFile reset bufio.Reader after EOF bufio.Reader caches EOF from the underlying file descriptor and won't see new bytes appended to the file without a reset. This caused relays to stop mirroring after SIGUSR1 reconnect — the tail found the file but never saw new content.

lmata 2026-04-04 19:29 trunk
Commit 8e7759add2afb7fbcea2ec0c774f1006f5c3f40a12a496f5d5641bd29680ae83
--- cmd/claude-relay/main.go
+++ cmd/claude-relay/main.go
@@ -402,10 +402,14 @@
402402
select {
403403
case <-ctx.Done():
404404
return nil
405405
case <-time.After(defaultScanInterval):
406406
}
407
+ // Reset the buffered reader so it retries the underlying
408
+ // file descriptor. bufio.Reader caches EOF and won't see
409
+ // new bytes appended to the file without a reset.
410
+ reader.Reset(file)
407411
continue
408412
}
409413
return err
410414
}
411415
}
412416
--- cmd/claude-relay/main.go
+++ cmd/claude-relay/main.go
@@ -402,10 +402,14 @@
402 select {
403 case <-ctx.Done():
404 return nil
405 case <-time.After(defaultScanInterval):
406 }
 
 
 
 
407 continue
408 }
409 return err
410 }
411 }
412
--- cmd/claude-relay/main.go
+++ cmd/claude-relay/main.go
@@ -402,10 +402,14 @@
402 select {
403 case <-ctx.Done():
404 return nil
405 case <-time.After(defaultScanInterval):
406 }
407 // Reset the buffered reader so it retries the underlying
408 // file descriptor. bufio.Reader caches EOF and won't see
409 // new bytes appended to the file without a reset.
410 reader.Reset(file)
411 continue
412 }
413 return err
414 }
415 }
416

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button