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.
Commit
8e7759add2afb7fbcea2ec0c774f1006f5c3f40a12a496f5d5641bd29680ae83
Parent
45a50366297ccd9…
1 file changed
+4
| --- cmd/claude-relay/main.go | ||
| +++ cmd/claude-relay/main.go | ||
| @@ -402,10 +402,14 @@ | ||
| 402 | 402 | select { |
| 403 | 403 | case <-ctx.Done(): |
| 404 | 404 | return nil |
| 405 | 405 | case <-time.After(defaultScanInterval): |
| 406 | 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) | |
| 407 | 411 | continue |
| 408 | 412 | } |
| 409 | 413 | return err |
| 410 | 414 | } |
| 411 | 415 | } |
| 412 | 416 |
| --- 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 |