Skip to content
Discussion options

You must be logged in to vote

#725 的描述——核心全部正确,但有一个坑

讨论里的说法 判定 依据
症状:所有工具调用报 unknown tool "" ✅ 对 本地会话完全一致(空名 ×3 → 400 终止)
根因:translate.ts 覆盖赋值,空 name/id 分块抹掉已解析名字 ✅ 对 源码/编译产物都是 !== undefined 覆盖;我本地旧逻辑复现输出 {id:"",name:""}
次生:空 callId 持久化 → 重启 SessionPersistenceCorruptionError "must have tool source" ✅ 对 刚核实 packages/core/session/src/index.ts:336-341 确实拒绝 callId === '';你 demo1 的 session-9fe8ba1d 就是实例

⚠️ 唯一要注意的坑——别照抄置顶答案的"拼接版"修法:

// 原作者的版本(不推荐提 PR)
if (call.id !== undefined) block.callId = (block.callId ?? '') + call.id
if (call.function?.name !== undefined) block.name = (block.name ?? '') + call.function.name

问题:① id/name 是身份字段不是累积字段,拼接语义错误——上游若是 null 会拼出 Globnull(讨论里 chenghu17 也指出这点),若重复发非空 name 会拼出 GlobGlob

Replies: 12 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wangziwei734
Comment options

Comment options

You must be logged in to vote
1 reply
@wangziwei734
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wangziwei734
Comment options

Answer selected by wangziwei734
Comment options

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