Repository navigation
[PR] fix(agent): pass merged headers to pfRequestHeaders so watermark count is emitted (#5813) - #5815
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.8921-pr.5815.761b04dThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5815.tgz
npm install -g packageInstall instructions are refreshed on each push. |
37270bd to
ec29e85
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 —— 检索了全部 open/closed issue 与在途 [PR],没有其它条目修同一机制(#5813 的 pfRequestHeaders 视图不对称);本线程即该缺陷的唯一修复 PR。 标签: 独立审核结论(PR #5815)我没有照抄 PR 描述,而是把分支拉到最新 master 上逐处重读了三个改动点、 审核中我做的两件事(已推上 PR 分支):
本地证据(rebased head): 结构化八问
|
(ai: vllm-qwen/qwen3.8-27b) CI 结论(补上轮回复的运行中部分):全绿。 head 最终判定不变:可合并——代码审核通过、定向套件 227/227 绿、typecheck 干净、CI 全绿、行为变更已披露(self 分支 dsh 直连请求补上插件身份头)。合并动作按规矩由你执行:#5815 |
…t is emitted (#5813) pfRequestHeaders was handed the pre-merge outgoing headers (outgoingHeadersOf of the client request), which never contains x-bili-plugin-conversation when the lane stamps it via state.headersFor (dsh lane production shape). The count header was therefore silently dropped every turn: 3795 evaluations, 0 hits, all no-stamp. All three call sites in native-intercept.ts now merge the headersFor result into the object passed to pfRequestHeaders: - routed branch: pfOutgoing + routedExtra - self branch: also merges headersFor into withHeaders (was missing entirely) - rewrite branch: rwOutgoing + rwRouted into pfRequestHeaders Regression tests cover the dsh-lane shape (convo header from headersFor, absent from client request) on both routed and self branches.
ec29e85 to
36a37f7
Compare
(ai: vllm-qwen/qwen3.8-27b) Conflict resolved & rebased. The PR branch was 575 commits behind What I did this run:
Local verification on rebased head: Honest status note: the mirror check-cache still reports the pre-push sha ( 结构化八问
收工判定:冲突已解、分支已对齐 master,rebase 后可合并(合并动作按规矩由你执行)。CI 在新 head |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Conflict resolved & rebased — done this run. What happened: PR branch was 575 commits behind What I did:
Verified on rebased head: Remaining / risk: mirror check-cache still reported the pre-push sha ( Verdict: mergeable after rebase — merge action stays yours. |
|
(ai: vllm-qwen/qwen3.8-27b) Review verdict: APPROVE This fixes the root cause named in #5813. The watermark chokepoint ( Correctness. All three chokepoint branches in
The self branch additionally merges Tests. Three new regression tests in Note: the body says "two new regression tests … 14 pf-channel tests"; the diff actually adds three (the file now has 15 top-level tests) covering one more branch than described — coverage is broader than the prose, immaterial to correctness. Scope. The server-side "read No 结构化八问(中文,供人工复核)
判定:可合(APPROVE)——修法打到根因、覆盖全部三发射点/五车道实现、测试真实可兜底、CI 绿、diff 干净、无越界。合并仍由 owner 执行。 |
(ai: vllm-qwen/qwen3.8-27b) Done — APPROVE, no blocking findings. Full review posted on the PR (#5815, comment 6765307634); the formal APPROVE review event is blocked because this identity is the PR author (self-approve refused), so the verdict is carried in that comment. One-line summary: root cause fixed at all three chokepoints (routed/self/rewrite) in |
[bot] 🏷 Review complete — APPROVE, no blocking findings. What I did: reviewed PR #5815 end-to-end (PR body, linked issue #5813, full diff, surrounding source, test file, CI state via the mirror cache). Outcome & evidence:
Where the verdict lives: formal APPROVE review event was refused (this identity is the PR author → can't self-approve), so the full review + Chinese 八问 checklist is posted as GitHub comment 6765307634 on PR #5815. Merge left to owner (human-only). |
Problem
pluginFullResendWatermarkwas enabled in production (dsh lane) but the fastpath had 0 hits in 3,795 evaluations — every single onemiss (no-stamp).Root cause:
pfRequestHeaders()innative-intercept.tswas called withoutgoingHeadersOf(input, init) ?? {}— the client's own request headers — which does NOT containx-bili-plugin-conversationwhen the lane stamps it viastate.headersFor(the dsh production shape). The function needs that header to look up the per-session stamp, so it always returned{}: the count header was never emitted.The asymmetry:
pfLearnStampIS called with the merged object (post-withHeaders), so it correctly learns T fromx-bili-pf-seq. The client learns the watermark but can never send it back.Fix
All three call sites in
src/agent/native-intercept.tsnow merge theheadersForresult into the object passed topfRequestHeaders:pfRequestHeaders(outgoingHeadersOf(input,init))pfRequestHeaders({...outgoing, ...routedExtra})withHeaders(input, init, pfRequestHeaders(outgoing))headersFor(url)into both the pf input AND the withHeaders callpfRequestHeaders(outgoingHeadersOf(input,init))pfRequestHeaders({...outgoing, ...rwRouted})Tests
Two new regression tests in
tests/pf-channel.test.tscover the dsh-lane shape (convo header fromheadersFor, absent from client request) on both routed and self branches. All 14 pf-channel tests + 78 native-intercept tests pass.Closes #5813