Repository navigation
[PR] batch-B: wire-format preservation — 3 fixes absorbed (original PRs superseded) - #7445
ranxianglei wants to merge 4 commits into
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.11180-pr.7445.bab6e88This 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)已修( |
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).