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.
This commit is contained in:
Levi Neely 2026-04-22 12:29:24 +02:00
parent 197c3664c6
commit f220d0ee96
1 changed files with 3 additions and 0 deletions

View File

@ -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 ""
}