Repository navigation
[PR] batch-B: wire-format preservation — 3 fixes absorbed (original PRs superseded) - #7445
Conversation
Set content_index=0 on the single-part text and marker lifecycles and legacy stream-error completions. Retain the source content index when proxy and plugin filters flush pending text, including plugin retry reframing. This prevents official SDK consumers from rejecting valid answers such as text ending in a buffered "m" as a missing content part. Record WC-026, enforce it in the matching fake and exercise actual OpenAI SDK consumption. The unchanged production fails ten focused regressions with ten controls passing; the fixed relevant suites pass all 193 tests. Typecheck, build, unused-export and test-import-graph gates also pass. (cherry picked from commit 3eec386)
Stop bounded inspection at the first over-budget chunk and replay its complete prefix and remaining stream through the existing response pipes. Do not classify a partial response or alter its fake-completion streak. Keep retry idle timers and client-abort listeners until the live response and optional raw dump finish. Error-body truncation remains unchanged. Validation: 5 baseline behavior failures and 2 passing exact-cap controls; 74 targeted tests pass. Typecheck, build and static gates pass. Codex preflight finds the CLI/artifact but the live upstream is unavailable; the real four-phase E2E and full remote CI remain pending. (cherry picked from commit 2703cbe)
Preserve the last upstream usage object when emitting the synthesized completion chunk. OpenAI clients that price a turn from provider fields (for example cost/credits) otherwise lose them. Forward the trailing usage-only frame to clients that set stream_options.include_usage, including text-only rounds, and reset the remembered usage per stream round so a later round cannot inherit a previous cost. Adds five regression tests in tests/openai-usage-frame-forward.test.ts. (cherry picked from commit 6228c39)
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11195-pr.7445.659a0d2This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr7445.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Picked up the PR review for #7445 ( |
…s on Windows (ERR_UNSUPPORTED_ESM_URL_SCHEME)
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — the only open PR targeting these three wire-format fixes is this batch; the original PRs (#7402, #7406, #7136) are superseded by it, and no sibling batch (A/C/D) touches the same files. Review of head ① Direction (original issues). All three are root-cause wire-fidelity restorations, not symptom masks:
② Regression review (existing behavior on touched paths).
③ Code review. No blocking findings; the mechanics above were verified line-by-line against the diff, not just the PR description. ④ Test teeth. 105/105 targeted suites pass locally ( ⑤/⑤b Diff & code cleanliness. Every line is on-topic; cherry-pick CI (live, mirror cache): 29/30 green on 八问(中文结构化结论)
判定:方向、回归、代码、测试、diff 五关全过;唯一红条(Windows 测试导入 bug)已修( |
(ai: vllm-qwen/qwen3.8-27b) CI 状态更正(接上条 review): 新 head 已按 plan job 的设计机制处理:给 PR 加 |
… Node 24) The postRun cleanup retry loop only tolerated EBUSY when rmSync hit a still-locked temp dir. Node 24 Windows runners surface the same locked-file condition as EPERM, which was rethrown and failed the test after its assertions had already passed (windows-24 shard 2, run 44885635654). Tolerate EPERM in the same retry-then-leave loop.
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) ci:full 全量矩阵(run 44885635654,head 0e6b83a)已跑完:35 个 job 中 34 绿、1 红。原红的 新红的是 已按小问题直接修:清理环同时容忍 EPERM(同属 Windows 锁文件条件,重试耗尽后照旧留目录由 OS 回收),本地 5/5 过,独立 commit 677af01 已推上分支。新 head 的 CI 已确认 plan scope: full(run 44888947408),矩阵跑完给最终判定。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 最终判定:全量 CI 已全绿,可合并(人工合并)。 最终 head
分支最终形态:3 个 cherry-pick 修复(#7402 / #7406 / #7136,原作者保留)+ 2 个 Windows 测试健壮性小修(各独立标注 commit,与本批 wire 修复无耦合,后续 rebase 可独立取舍)。完整八问审核结论见前一条回复,无阻塞发现;两处行为变更(超限 fake-completion 转实时透传、usage-only 帧对 include_usage 客户端在纯文本轮也转发)均已在 PR 描述披露。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1252-master.5d7a49f # this exact build
npm install -g billion-context@master # always the newest merged build
|
What this batch is
One PR absorbing three small, already-reviewed wire-format preservation fixes. Each original PR was cherry-picked with
-x, so the original authorship and full commit messages are preserved. The three fixes all keep what the model/client already got on the wire instead of dropping or corrupting it in proxy-synthesized frames.Absorbed original PRs
content_index), so the official OpenAI Node SDK threwmissing content at index undefinedon ordinary answers (e.g. text ending in a bufferedm). Now setscontent_index: 0on single-part text/marker lifecycle frames, preserves the source index in proxy and plugin tail flushing (incl. retry reframing), and adds wire-contract rule WC-026 with real OpenAI-SDK consumption regressions.cost/credits) that some OpenAI clients price from, and the trailing usage-only frame was only forwarded when a tool call had been seen. Now the last upstream usage object is preserved into the synthesized completion (normalized token fields still win), the usage-only frame is forwarded to clients that setstream_options.include_usageon text-only rounds too, and remembered usage resets per stream round so a later round can't inherit a previous cost.Fixes
Related references mentioned in the original PR bodies (context only, NOT closed by this PR): #2691, #1464, #5057 (#7402's related history); #378, #486, #1904, #7203 (#7406's related history); #1766 (#7136's follow-up direction).
原 PR 处理
#7402、#7406、#7136 将在本批合并后关单,并注释收编进本批 (this PR). 本批未自行关闭或评论任何原 PR。
Validation (local, pre-push)
responses-content-index,fake-completion-buffer-limit,stream-buffer-budget,openai-usage-frame-forward,proxy-stream-error,fake-completion,fix-stream,wire-contract.npm ci+npm run build(kernel + pi-subagents + tsup) clean.testlanes on this head (§7.2).