fix(chat): complete streaming for reasoning, tools, and tool calls

- Forward reasoning_content and non-stream reasoning to on_token in
  OpenAI chat completions; Gemini thought parts to on_token.
- Stream bubble: always render session.tool panels; format tool_use_call
  payloads and title as call · tool_name.
- Emit tool_use_call via on_tool_ui before tool execution so WS shows
  invoke cards before tool_use_result.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-05-10 14:02:14 +08:00
parent 75a3038f33
commit 398d85ba06
4 changed files with 68 additions and 17 deletions

View file

@ -224,6 +224,8 @@ class GoogleGeminiChatModel(ChatModel):
txt = str(p.get("text") or "")
if txt:
thinking_parts.append(txt)
if on_token:
on_token(txt)
sig = p.get("thoughtSignature")
if isinstance(sig, str) and sig:
thinking_signature = sig