Summarize progress counts reasoning tokens: thinking models stream most of the run in reasoning_content, which the ticker ignored — UI sat at 'waiting for model' then jumped to done with no percentage

This commit is contained in:
avi 2026-09-16 18:28:59 -05:00
commit 0a0702f15d
3 changed files with 43 additions and 4 deletions

View file

@ -117,9 +117,13 @@ async def _collect_reply(resp: httpx.Response, ticker) -> str:
except ValueError:
continue
piece = (obj.get("message") or {}).get("content") or ""
if piece:
# Like the openai_compat adapter: a thinking channel is real
# work and must move the progress ticker even when the server
# ignored think:false.
thinking = (obj.get("message") or {}).get("thinking") or ""
if piece or thinking:
parts.append(piece)
total += len(piece)
total += len(piece) + len(thinking)
ticker(total)
if obj.get("done"):
break