zot/internal/core
patriceckhart fdef8ac614 core: drop empty session files instead of writing meta-only stubs
every zot launch was creating a session file with just a meta line,
even when the user exited without prompting. /sessions and ls -la
ended up showing dozens of empty entries.

now Session tracks messagesAppended and freshFile (true for
NewSession, false for OpenSession). Close() removes the file when
both conditions hold: this process created it AND no messages
were ever appended. resumed sessions are never auto-deleted even
if the resume run added nothing, since the prior content is real.

PruneEmptySessions sweeps existing meta-only stubs from the cwd's
session dir on each interactive launch. cheap (only reads enough
of each file to find a 'message' line) and fixes the existing
backlog automatically the first time you reopen zot in a project.
2026-04-19 11:38:57 +02:00
..
agent.go initial commit 2026-04-17 20:36:38 +02:00
compact.go initial commit 2026-04-17 20:36:38 +02:00
core_test.go fix ci on windows: close reopened session in TestSessionRoundTrip 2026-04-18 11:01:42 +02:00
cost.go initial commit 2026-04-17 20:36:38 +02:00
events.go initial commit 2026-04-17 20:36:38 +02:00
session.go core: drop empty session files instead of writing meta-only stubs 2026-04-19 11:38:57 +02:00
tool.go initial commit 2026-04-17 20:36:38 +02:00