fix(streaming): strip Gemma 4 thinking token delimiter in all paths — closes #607

Fixes <|turn|>thinking delimiter (was wrong as <|turn>thinking) in api/streaming.py, static/messages.js, and static/ui.js. Adds 13 regression tests. Independent review by @nesquena.
This commit is contained in:
nesquena-hermes
2026-04-17 23:45:39 -07:00
committed by GitHub
parent 7cb5547056
commit bded1cf906
7 changed files with 146 additions and 4 deletions

View File

@@ -144,7 +144,8 @@ function attachLiveStream(activeSid, streamId, uploaded=[], options={}){
// Thinking tag patterns for streaming display
const _thinkPairs=[
{open:'<think>',close:'</think>'},
{open:'<|channel>thought\n',close:'<channel|>'}
{open:'<|channel>thought\n',close:'<channel|>'},
{open:'<|turn|>thinking\n',close:'<turn|>'} // Gemma 4
];
function _isActiveSession(){