Skip to content

腾讯后端(copilot.tencent.com)流式返回 tool_calls 时参数损坏 #3

Description

@zeros335882878

问题描述

通过 codebuddy2openai 转换器接入 DeepSeek 模型(deepseek-v4-flash / pro)时,后端 copilot.tencent.com 在**流式(stream=true)**返回 tool_calls 时,参数间歇性损坏:

  • function.name 返回空字符串(""
  • arguments 为乱码片段或空串(非完整 JSON)

影响

客户端(如 DeepSeek Harness / Codex CLI / Claude Code)收到后:

  • 空 name → 执行时报 unknown tool ""
  • arguments 解析失败 → 报 "arguments" must be an object / missing required property
  • 最终导致 agent 陷入无限重试循环

关键观察

  • 非流式(stream=false) 请求下 tool_calls 参数完整正常(实测 flash/pro 多次均健康)
  • 流式(stream=true) 请求下间歇损坏,同一请求需重试多次才可能拿到正常结果
  • 转换器目前只能用「聚合 + 校验 + 损坏重试 + 伪流式转发」的方式 workaround 才能稳定工作

环境

  • 转换器:v2(直连后端)
  • 模型:deepseek-v4-flash / deepseek-v4-pro(腾讯后端)
  • 后端:https://copilot.tencent.com/v2/chat/completions

期望

希望确认这是后端流式 tool_calls 分片传输的问题,并能修复;或在文档中标注该已知限制,方便接入方规避。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions