Skip to content

Conversation

@MIKUSCAT
Copy link
Contributor

@MIKUSCAT MIKUSCAT commented Feb 6, 2026

背景

在 antigravity 非流式请求(内部走 stream2nostream)场景下,流收集器只合并了 thought/text,未保留 functionCall/functionResponse。
这会导致工具调用信息丢失,表现为:

  • OpenAI 格式:常见为无内容/无 tool_calls,流程提前结束
  • Gemini 格式:只看到思考块,但不会继续工具调用

变更内容

  • collect_streaming_response 中补充保留工具相关 part:
    • functionCall
    • functionResponse
    • function_call(兼容键)
  • 新增工具 part 统计日志,便于定位此类问题

验证

  • 语法检查通过:python3 -m py_compile src/api/utils.py
  • 复现场景下可观察到收集日志包含 tool parts(不再是 0)
  • 工具调用链可继续推进,不再停在思考块

影响范围

  • 仅影响 antigravity 的 stream2nostream 收集路径
  • 不改变外部接口字段结构,兼容现有调用方

风险与回滚

  • 风险较低;如需回滚,可仅回退 src/api/utils.py 的本次改动

@su-kaka su-kaka merged commit 6aa84be into su-kaka:master Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants