ScuttleBot
fix: mirror loop uses epoch time on reconnect to find existing session file
Commit
2b4042164cf38390b61c181d191bebdeb7825d558e754210b3c63646e7ed1af0
Parent
e6c41b360806db3…
1 file changed
+3
-1
+3
-1
| --- cmd/claude-relay/main.go | ||
| +++ cmd/claude-relay/main.go | ||
| @@ -702,11 +702,13 @@ | ||
| 702 | 702 | filepath.Base(cfg.TargetCWD), cfg.Nick, |
| 703 | 703 | )) |
| 704 | 704 | fmt.Fprintf(os.Stderr, "claude-relay: reconnected, restarting mirror and input loops\n") |
| 705 | 705 | |
| 706 | 706 | // Restart mirror and input loops with the new connector. |
| 707 | - go mirrorSessionLoop(ctx, conn, cfg, startedAt) | |
| 707 | + // Use epoch time for mirror so it finds the existing session file | |
| 708 | + // regardless of when it was last modified. | |
| 709 | + go mirrorSessionLoop(ctx, conn, cfg, time.Time{}) | |
| 708 | 710 | go relayInputLoop(ctx, conn, cfg, state, ptmx, now) |
| 709 | 711 | break |
| 710 | 712 | } |
| 711 | 713 | } |
| 712 | 714 | } |
| 713 | 715 |
| --- cmd/claude-relay/main.go | |
| +++ cmd/claude-relay/main.go | |
| @@ -702,11 +702,13 @@ | |
| 702 | filepath.Base(cfg.TargetCWD), cfg.Nick, |
| 703 | )) |
| 704 | fmt.Fprintf(os.Stderr, "claude-relay: reconnected, restarting mirror and input loops\n") |
| 705 | |
| 706 | // Restart mirror and input loops with the new connector. |
| 707 | go mirrorSessionLoop(ctx, conn, cfg, startedAt) |
| 708 | go relayInputLoop(ctx, conn, cfg, state, ptmx, now) |
| 709 | break |
| 710 | } |
| 711 | } |
| 712 | } |
| 713 |
| --- cmd/claude-relay/main.go | |
| +++ cmd/claude-relay/main.go | |
| @@ -702,11 +702,13 @@ | |
| 702 | filepath.Base(cfg.TargetCWD), cfg.Nick, |
| 703 | )) |
| 704 | fmt.Fprintf(os.Stderr, "claude-relay: reconnected, restarting mirror and input loops\n") |
| 705 | |
| 706 | // Restart mirror and input loops with the new connector. |
| 707 | // Use epoch time for mirror so it finds the existing session file |
| 708 | // regardless of when it was last modified. |
| 709 | go mirrorSessionLoop(ctx, conn, cfg, time.Time{}) |
| 710 | go relayInputLoop(ctx, conn, cfg, state, ptmx, now) |
| 711 | break |
| 712 | } |
| 713 | } |
| 714 | } |
| 715 |