From f220d0ee967c96d6cd45fed4010111224349a4ef Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Wed, 22 Apr 2026 12:29:24 +0200 Subject: [PATCH] feat: add tail script to session files Adds a synthetic `tail` file (mode 0555) to each session directory that runs `tail -f chat`, allowing users to follow a session's chat log from any working directory. --- pkg/store/sessionfile.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/store/sessionfile.go b/pkg/store/sessionfile.go index e1562b0..731a50b 100644 --- a/pkg/store/sessionfile.go +++ b/pkg/store/sessionfile.go @@ -37,6 +37,7 @@ var SessionFileList = []struct { {"models", 0444}, {"systemprompt", 0444}, {"params", 0666}, + {"tail", 0555}, } // SessionFileStore implements Store for the files within a single @@ -327,6 +328,8 @@ func (s *SessionFileStore) content(name string) string { return fmt.Sprintf("%d\n", s.sess.ChatOffset) case "params": return FormatParams(s.sess.Core.GenerationParams()) + case "tail": + return "#!/bin/sh\nexec tail -f \"$(dirname \"$0\")/chat\"\n" } return "" }