Watch the reasoning as it is written, and hold the view where you put it

This commit is contained in:
Gmer4Lfe
2026-08-10 22:33:57 -04:00
parent 25361fafdb
commit 66f427dd2d
2 changed files with 116 additions and 19 deletions
+5 -2
View File
@@ -936,10 +936,13 @@ while (($line = fgets($fh)) !== false) {
$now = microtime(true);
if ($now - $lastFlush >= $FLUSH_SEC) {
$lastFlush = $now;
// thinking_chars rather than the reasoning itself: with think on, nothing lands in
// content for ~15s, and a page that only watched partial would look hung.
// The reasoning rides along as well as its length. The count alone is what keeps the
// phase line honest during the ~15s before any content lands; the text is what the
// page shows when the operator has asked to watch it happen. Both are cheap here —
// the job file is tmpfs and the poll is a loopback request.
jw($jobFile, ['status' => 'generating',
'partial' => $answer,
'thinking' => $thinking,
'thinking_chars' => strlen($thinking),
'sources' => $sources]);
}