Repository navigation
docs+feat: #1518 — dsh interop note + observe-only telemetry for malformed tool-call args - #1521
ranxianglei wants to merge 3 commits into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1650-pr.1521.d9d2797This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1521.tgz
npm install -g packageInstall instructions are refreshed on each push. |
PR #1521 复核完成(分支已拉取本地核对,未重做工作)。结论:可以合并。 核对项
内容审核(对照 #1518 调查结论逐项验证)
后续
一句话中文摘要:这是纯文档的 dsh 互操作注记(README en/zh 各一条,+20/-2),内容与 #1518 调查结论逐项核对无误、CI 12/12 全绿、与 master 无冲突,可以合并。 |
|
冲突 |
0bf179a to
a34f790
Compare
[bot] 🏷 冲突已解决,分支已 rebase 到当前 master 并 force-push。 冲突根因分支 base(8c41b0e)之后 master 走了 8293a54,两处漂移同时撞上本分支:
解决方式(不改变任何原 commit 语义)
顺手小修(独立标注 commit a34f790)全量测试暴露一个 master 上已存在的测试损坏(与本 PR 无关,先在干净 master worktree 复现确认): 验证(rebased head a34f790)
行为变更声明无新增。wire 零变化(转发字节逐字节不变,#1039 契约);仅新增 plugin 模式 warn 级日志(每个坏参数一行);无 config surface;无 version bump。PR 描述已同步更新(rebase 说明 + Part 3 + 新 preflight 数字)。 中文摘要:解决了 master README 重组与 plugin.ts 漂移造成的双重冲突(bullet 搬到 CLIENTS*.md、plugin.ts 取并集保持双方语义),顺手修掉一个 master 既有的测试 rmSync 未导入损坏,本地全量测试与 CI 均全绿,可以合并(合并操作由你执行)。 |
Refs #1518 (issue stays open as investigation).
One issue, one PR, three clearly-separated commits. Rebased onto current master (8293a54) after the owner flagged a conflict — master had moved on both fronts since the branch base: the client deep-dives were reorganized OUT of README.md/README.zh-CN.md into new CLIENTS.md/CLIENTS.zh-CN.md files, and
src/plugin.tsgained ~200 lines of unrelated work (#1684 dsh-acp-invocation-session et al.). Resolution: interop bullet relocated into the dsh sections of CLIENTS.md/CLIENTS.zh-CN.md (text unchanged); one addition/addition conflict inpipePluginJsonresolved by union (master's #1595diagnoseSuccessWithoutUsageline + this PR's observe block, both kept).Part 1 — docs (commit cab6d7e)
One bullet each in the dsh sections of CLIENTS.md / CLIENTS.zh-CN.md (mirrored en/zh): plugin-mode
compressargs are model-generated and host-parsed strictly; the observed escape-error class is semantic (structural-vs-content quote judgment), unrecoverable by any syntactic salvage ladder, and bili passes plugin-mode responses verbatim (no seat at the parsing table). Hosts that fail-loud on such args (MALFORMED_RESPONSE) should add that code to their retry whitelist (retryPolicy.retryableCodeson DSH) — escape errors are sampling noise, one extra full call usually succeeds. Root fix (provider constrained decoding, e.g. DeepSeek Betatools[].function.strict, Chat Completions wire only) is a host/provider work item.Part 2 — feat: observe-only diagnostics (commit dae0e29)
Closes the visibility gap named in the issue: in plugin mode the host parses tool-call args at its terminal and bili previously had ZERO trace of what the host was about to reject (the reporter had to reconstruct argument deltas by hand out of 77 zstd-framed session logs).
What it does:
pipePluginChatWithStripopenai/anthropic/google,pipePluginResponsesWithStrip, non-streamingpipePluginJson) to accumulate the final argument STRING per model-emitted tool call.JSON.parses each accumulated arg; on failure logs ONE warn per bad arg:[plugin] [<session>] malformed tool-call args forwarded verbatim (<protocol>, tool=<name>, len=<N>, err@<pos>): <V8 error class> (#1518 observe-only)— the same V8 taxonomy the reporter computed on the 21 production failures (position/line-col/embedded-snippet suffixes stripped, so no payload content is ever echoed into the log).Hard guarantees (each pinned by test):
function_call_arguments.deltabranch writes the identicalrawEvent + "\n\n"the generic fallthrough wrote; [bug] 插件透传会剥掉工具调用参数里的 render tag(arguments 流挂了 tag-echo 过滤器) #1039 verbatim contract intact).input/ geminiargsare parse-valid by construction.Tests: new
tests/malformed-toolcall-args-observe.test.ts, 10 tests — malformed + clean + empty-args + proxy-lane-gate cases across all four shapes (openai chat SSE, anthropic SSE, responses SSE, non-streaming JSON openai/responses), asserting both the warn line contents AND verbatim passthrough of the offending bytes.Part 3 — in-passing fix for pre-existing master breakage (commit a34f790)
Labeled, separate commit:
tests/issue1086-chain-self-exemption.test.tsline 728 called barermSync(...)without importing it (ReferenceError — the file importsrmrffromtests/tmp-rm.ts, used by all 10 sibling cleanup sites;rmrfalso carries the #1646 CI ENOTEMPTY retry that a bare rmSync lacks). Reproduced identically on pristine master 8293a54 before touching it. One-word fix:rmrf(root).Preflight (rebased head a34f790, atop master 8293a54)
npm run typecheck— cleannpm test— full suite green after the Part 3 fix (pre-fix run: 3268 pass / 1 fail, the fail being exactly the pre-existing breakage above; post-fix single-file run 21/21; final full-suite confirmation in the issue reply)npm run build— successBehavior changes
None on the wire. New log lines only (warn level, one per bad arg, plugin mode only). No config surface added. No version bump.