Commit Graph
10 Commits
Author SHA1 Message Date
Anthony Ruiz b28559f62c test(streaming): exercise an echo that really falls outside the search window
The case labelled as an echo further back than the window still ended the
buffer with the suffix, so it matched regardless of the window. Replace it
with a buffer whose whitespace-padded echo spans more than the default
window, and add a dedicated test proving the same echo is rejected with the
default window and found once the window covers it, for both the optimised
scan and the reference oracle.
2026-09-03 09:41:27 +00:00
Anthony Ruiz c6a2c1b7d2 perf(streaming): fold the echo search window once instead of per cut index
`_strip_compact_echo_suffix` probed every candidate cut index and re-folded
the whole remaining tail for each probe, so the cost grew with
`window x suffix` rather than with the data actually inspected. It runs up to
four times per interim assistant message, on the reasoning buffer, the shared
stream mirror and up to two per-message segments.

The practical effect is worst on the longest message of a turn: 297ms for a
200-character message but 5.6s for a 6000-character one, measured on the live
process. That time is spent holding the GIL, so a single long final message
also stalls every other stream served by the same worker. Profiling a live
turn attributed ~5% of total CPU to this one helper.

Fold the window once, then walk backwards across exactly as many non-space
characters as the folded suffix holds. `str.isspace` and the `\s` pattern used
by `_compact_for_echo_compare` agree on all 1114112 Unicode code points, so
the folded view and the walk stay consistent.

Behaviour is unchanged, including the leftmost-cut tie-break on repeated text
and the bounded search window. The new test pins equivalence against a naive
reference oracle over ~2020 cases (exact, partial and absent echoes, mixed
whitespace, unicode, empty and None inputs, repetitions, out-of-window
echoes), asserts the fold no longer runs once per cut index, and caps the
runtime of a long-conclusion call.

Measured: 200 chars 297ms -> 0.149ms, 6000 chars 5645ms -> 0.720ms.
2026-08-27 23:58:18 +00:00
Anthony Ruiz 127a57e0c5 fix(sessions): fully consume PWA launch action 2026-07-29 21:50:54 +00:00
Anthony Ruiz cd04f5fcc2 fix(sessions): preserve active chat across hard refresh 2026-07-29 21:50:54 +00:00
Anthony Ruiz 87a9e25e41 fix(csv): keep media downloads visible in previews 2026-07-08 19:51:38 +00:00
Anthony Ruiz 5901ed68e1 fix(steer): scope upload UX to owner session 2026-07-05 16:02:54 +00:00
Anthony Ruiz b1a200f166 fix(composer): suppress stale draft restore after send 2026-07-04 08:06:33 +00:00
Anthony Ruiz 20260e2c29 fix(webui): keep handled clarify 404s out of warn logs 2026-07-01 17:17:11 +00:00
Anthony Ruiz 76ae2b795c test(webui): make live-transition guard anchors explicit 2026-07-01 15:50:24 +00:00
ruizanthony 0c13a17231 fix(webui): stop live streaming message flicker
Opt live assistant streaming nodes out of the global theme color/background transitions so token-by-token markdown updates do not flash or fade on light themes.

Adds a targeted regression test in test_smooth_text_fade.py while keeping the opt-in smooth text fade feature intact.
2026-07-01 07:38:44 +00:00