Fix log.raw streaming: add Stream handler back

This commit is contained in:
Levi Neely 2026-10-09 19:37:58 +02:00
parent 6cf283044e
commit 8ce50452a1
2 changed files with 2 additions and 5 deletions

View File

@ -820,7 +820,7 @@ func buildAgentChildren(a *agent.Agent, s *session.Session) []virtfs.FsNodeDecl
),
// log.raw — JSONL (one Block per line), for GUI/programmatic access
virtfs.FileNode("log.raw", 0440,
virtfs.Doc("JSONL chat log. One JSON block per line."),
virtfs.Doc("JSONL chat log. One JSON block per line. Streaming."),
virtfs.StatOverride(chatStat),
virtfs.Read(func() ([]byte, error) {
a.ChatMu().RLock()
@ -830,6 +830,7 @@ 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,

View File

@ -192,7 +192,6 @@ QHash<int, QByteArray> ChatBlockModel::roleNames() const
void ChatBlockModel::appendData(const QString &text)
{
qDebug() << "ChatBlockModel::appendData len=" << text.length() << "text=" << text.left(200);
m_lineBuffer += text.toUtf8();
// Process complete JSONL lines
@ -201,7 +200,6 @@ void ChatBlockModel::appendData(const QString &text)
QByteArray line = m_lineBuffer.left(idx);
m_lineBuffer = m_lineBuffer.mid(idx + 1);
if (!line.isEmpty()) {
qDebug() << "ChatBlockModel: processing line:" << line.left(100);
processJsonLine(line);
}
}
@ -224,8 +222,6 @@ void ChatBlockModel::processJsonLine(const QByteArray &line)
QString format = obj["format"].toString();
bool partial = obj["partial"].toBool(false);
qDebug() << "ChatBlockModel::processJsonLine role=" << role << "id=" << id << "content.len=" << content.length();
// Skip context blocks from rendering (context is for LLM, not display)
if (role == "context") {
return;