ScuttleBot

fix: mirror loop uses epoch time on reconnect to find existing session file

lmata 2026-04-04 00:48 trunk
Commit 2b4042164cf38390b61c181d191bebdeb7825d558e754210b3c63646e7ed1af0
1 file changed +3 -1
--- cmd/claude-relay/main.go
+++ cmd/claude-relay/main.go
@@ -702,11 +702,13 @@
702702
filepath.Base(cfg.TargetCWD), cfg.Nick,
703703
))
704704
fmt.Fprintf(os.Stderr, "claude-relay: reconnected, restarting mirror and input loops\n")
705705
706706
// 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{})
708710
go relayInputLoop(ctx, conn, cfg, state, ptmx, now)
709711
break
710712
}
711713
}
712714
}
713715
--- 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

Keyboard Shortcuts

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