Skip to content
Discussion options

You must be logged in to vote

你的机制判断方向对,这属于 wire identity-loss 家族(同族已有多起:#5268 GLM 同响应重复 callId、#5182 空 id、#5247 前端 dup-start)。对照上游 master(4e84901e64 = 0.1.2-alpha.4),DSH 侧有一个真实的不对称点 + 一个需要你提供判别信息的层级问题:

1. BlockAssembler 的 id/name 处理不对称(llm/src/assembler.ts)

  • :72 partial.toolCallId = chunk.id —— 无条件覆盖,后续 chunk 带空 id 会直接抹掉首帧有效 id;
  • :73 if (chunk.name) partial.toolCallName = chunk.name —— name 有 truthy 守卫,空 name 覆盖不了首帧;
  • :108-121 assemble() 的兜底 partial.toolCallId ?? call-${index} 只救 nullish——空字符串不是 nullish,'' ?? 兜底 仍得 ''

也就是说:只要 delta 流里出现过一次 id: ""(空字符串存在而非字段缺失),DSH 最终就拿空 id 去执行。name 有守卫所以通常能活下来——你看到「unknown tool ''」,如果空的是 name 而不是 id,说明空值是从 block-end 的权威 block 带进来的(见下)。

2. 层级问题:覆盖发生在 pi-ai 内部还是 DSH 之外?
pi-ai adapter(l…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fufuuuu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants