Repository navigation
|
Environment: dsh 0.1.3-alpha.1 ( Problem: the upstream model returned the same and the whole session becomes unusable (every follow-up re-sends the same history). Evidence: session history contains Suggested fix: guarantee tool-call ids are unique across the session when appending assistant Related: #1593 (tool result referencing a missing call id also bricks a session with provider 400s). |
Replies: 3 comments
|
Checked both source claims against current master, both exact. message.ts:238 is really the verbatim passthrough: toolCallId: input.callId, no transformation. And assembler.ts:115 is really id: partial.toolCallId ?? brandString( Worth connecting this to #1593, which argszero investigated in depth: that one is the mirror case, a tool/result referencing a call id that was never emitted at all (orphan result instead of your duplicate/collision). Same underlying gap either way: nothing between history assembly and wire serialization checks that assistant tool_calls and the following tool messages actually correspond one-to-one. argszero's writeup there also names two more related threads (#1449, #1519) covering truncated/replayed tool-call arguments hitting the same seam. Four separate trigger paths into one missing validation is a stronger case for a real fix than any one report alone, might be worth linking your report into that family when raising it. Your fix direction (rewrite the later duplicate and remap the matching tool message before it reaches serialization) matches the pattern argszero suggested for the orphan case too: catch it at assembly/serialize time with a fail-fast or auto-correct pass, rather than only after a provider round-trips a 400. |
EN / EnglishAn outside research team — we use DSH daily, mostly on the npm line. Mide69's source confirmation above is complete; adding only the family connection. This report (#5732) is the writer-side origin of a family we consolidated today in a comment on #5692: non-unique tool-call ids from the model/provider flow verbatim into the session, and every downstream reader that assumes uniqueness fails differently — strict providers reject the history with a 400 (this thread), the v0→v1 migrator refuses the whole session (#5909 Mode A), and the client Authorship note: reproduced and documented by me in real-world usage; root-cause tracing and drafting assisted by AI; verification and publication by me. I have no engineering background — if any technical claim reads wrong, please call it out; I will re-verify against the toolchain and correct. Reported by the OfferKuai Team — Founder: Zhaofeng (Yaming). Website: https://www.offerkuai.com/ | Contact: contact@offerkuai.com 中文版 / ZH我们是外部研究团队——日常使用 DSH(以 npm 线为主)。上面 Mide69 的源码确认已经完整;这里只补家族连接。 本条报告(#5732)是我们今天在 #5692 评论区汇总的那个家族的写端源头:模型/服务方产出的非唯一 tool-call id 原样流入会话,而每个假设唯一性的下游读端都以不同方式失败——严格 provider 以 400 拒绝历史(本帖)、v0→v1 迁移器拒收整个会话(#5909 Mode A)、客户端 协作说明:本文由我在真实使用中复现并记录;根因与成文由 AI 协助完成,我负责校验与发布。我非工程背景,技术表述如有错误,欢迎指出——我会回去用工具链重新验证后更正。 本报告由 OfferKuai(Offer快)团队提交 —— 创始人:Zhaofeng(Yaming)。官网:https://www.offerkuai.com/ | 联系:contact@offerkuai.com |
补充确认:同轮内重复 tool_call_id(相邻双写形态)ENEnvironment: Windows 11 / Node 24 / dsh Symptom: the session becomes permanently unusable — every model fails with: The UI also fails to render: Evidence (3 sessions on disk, one night): the model emitted the same The duplicated id is stored as the byte string New finding — two shapes, only one is acute: scanning 164 local session files, 30 contain duplicated ids:
New finding — a diagnostic signature that identifies the culprit provider: DSH stores each tool call id as |. Across all local sessions the two halves are identical (self-reflection: the provider echoes DSH's id back instead of returning its own) for exactly one provider: text Repair (works, host restart required): drop the second tool/call+tool/result pair, keep all other events. Constraint: session.v3.jsonl.zstd is append-style multi-frame zstd with one event per frame, and the first frame must be exactly one header line — recompressing into a single frame bricks boot (corrupt Zstandard session log: first frame is not exactly one header line). Suggested fix: enforce session-wide unique toolCallId at history append (rewrite the later occurrence + remap its tool message), and make the assembler isolate rather than fatal-throw on the duplicate start Match (same ask as the #5692 family). This report was submitted by the @dsh-auto-memory team. Repository URL: https://github.com/Aik358/dsh-auto-memory 中文环境:Windows 11 / Node 24 / dsh 现象:会话永久不可用——所有模型都报上面那两条 400;界面同时卡加载( 证据(一夜 3 个会话,磁盘日志):模型在同一个 step 内输出了两次相同的 新发现——两种形态,只有一种致命:扫本地 164 个会话,30 个含重复 id——相邻双写(差 2 条,3 个会话,会话永久不可用)vs 跨 turn 复用(相差数万条,27 个会话,当前被容忍但切换严格 provider 即同样失效)。 text 修复方式(有效,需重启宿主):删除第二次出现的 tool/call+tool/result 对,其余保留。约束:会话日志是追加式多帧 zstd、一帧一事件,首帧必须恰好是 session 头一行——压成单帧会导致启动失败。 建议修复:历史 append 处强制会话内 toolCallId 唯一(改写后出现的那次 + 重映射其 tool 消息);assembler 在重复 start Match 时隔离该块而非致命抛出(与 #5692 家族一致)。 本报告由 @dsh-auto-memory团队提交,仓库地址:https://github.com/Aik358/dsh-auto-memory |
Checked both source claims against current master, both exact.
message.ts:238 is really the verbatim passthrough: toolCallId: input.callId, no transformation. And assembler.ts:115 is really id: partial.toolCallId ?? brandString(
call-${index}) — that fallback only fires when the model gives no id at all, so it genuinely can't be the source of a repeated id like you already ruled out. I also grepped the whole llm package tree for anything resembling a uniqueness check on tool call ids (a Set, a dedup pass, anything) and found nothing at all. So "no session-wide uniqueness guarantee" isn't just plausible, it's confirmed by absence.Worth connecting this to #1593, which argszero investigated …