Make log.raw a one-shot read, not a stream

A Stream handler on log.raw blocks the GUI's synchronous startup read
forever, so the window never renders. Live updates come from the
separate chat and event streams.
This commit is contained in:
Ollie Agent 2026-10-10 15:39:54 +02:00
parent 8ce50452a1
commit e7c9a34c3b
1 changed files with 6 additions and 3 deletions

View File

@ -818,9 +818,13 @@ func buildAgentChildren(a *agent.Agent, s *session.Session) []virtfs.FsNodeDecl
return []byte(item), nil
}),
),
// log.raw — JSONL (one Block per line), for GUI/programmatic access
// log.raw — JSONL (one Block per line), for GUI/programmatic access.
// MUST be an ordinary one-shot read (returns a snapshot and EOFs),
// not a stream: the GUI reads it synchronously at startup. A Stream
// handler here blocks that read forever and the window never renders.
// Live updates come from the separate "chat" and "event" streams.
virtfs.FileNode("log.raw", 0440,
virtfs.Doc("JSONL chat log. One JSON block per line. Streaming."),
virtfs.Doc("JSONL chat log. One JSON block per line."),
virtfs.StatOverride(chatStat),
virtfs.Read(func() ([]byte, error) {
a.ChatMu().RLock()
@ -830,7 +834,6 @@ func buildAgentChildren(a *agent.Agent, s *session.Session) []virtfs.FsNodeDecl
copy(data, raw)
return data, nil
}),
virtfs.Stream(a.RawLogRead, a.ChatSignal),
),
// log — Rendered plain text for TUI/humans (non-blocking read)
virtfs.FileNode("log", 0440,