Repository navigation
fix: threads-lane reforge side-call hits the chat endpoint instead of the bare origin - #3579
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4229-pr.3579.fded700This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3579.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。本条是 PR #3579(修 #3569)的 [PR] 镜像;按「threads reforge」「summary side-call」「executeThreadsReforge」检索 open+closed issue/PR,无同症状同机制的其他条目。关联项:#3516 条目 4④(threads-lane 裸 fetch 绕过代理 dispatcher)与本 PR 同一处代码、同一次修复,已并入;#3583(CI 这是本仓库 agent 已完成的 PR,我不重做工作——现在做独立审查:拉分支核对代码、回归清点、CI 状态确认,随后给出结构化八问结论。 |
(ai: vllm-qwen/qwen3.8-27b) 独立审查完成。没有复用 issue 侧已有结论——代码、测试、CI 全部自己重新核过一遍。 审查依据(独立验证)
结构化八问
回归审计清单(审过的既有行为及结论)
CI 状态(head 567c9fd):44 条 lane 全部 completed,43 条 success(含被门控跳过的 e2e 类),唯一红的是 发现(非阻塞)
判定:方向对(修根因不修症状)、实现干净、测试有牙(对照实验证明)、无回归、diff 整洁。可合并——唯一前置是那条 windows 红 lane:请 owner 点一下 Re-run failed jobs(run 链接见 #3569 线程 floor 7),预期转绿;若重跑仍挂在同一断言,那将推翻假红假设,按真回归处理再深挖。合并动作本身归人工(系统规则禁止 agent 合并)。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.538-master.63956ea # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #3569
Also resolves the dispatcher half of #3516 item 4④ (
src/server/threads-lane.tsraw fetch bypassing the proxy dispatcher → forced-proxy deployments stall each turn up to the side-call timeout): the side call now rides the same proxy decision as the main forward.What was wrong
The threads-lane reforge (rollout
BILI_ROLLOUT_ANTHROPIC_THREADS_REFORGE, default off) summarizes the folded prefix with one non-stream Anthropic-style side call. It was POSTed to the upstream origin (route.upstream, e.g.https://api.anthropic.com) becausehandle.tspassed(route0?.upstream ?? opts.upstream ?? "")straight intoexecuteThreadsReforge, which fetched that URL verbatim. Real providers 404 the root path, so every over-window continue failed open: full transcript re-uploaded + ~0.4 s latency per turn, andfoldedBeforestayed 0 forever. The #3332 fake upstream answered any path with 200, so the suite never saw it.Changes
src/server/handle.ts: derive the side-call target withbuildForwardTarget(req, opts, route)— the same function the main forward uses — so the side call lands on the exact endpoint the client hit (full URL incl. path/query, e.g./v1/messages?beta=true) through the same proxy decision.src/server/threads-lane.ts:proxyUrlparameter; the fetch now goes throughfetchWithTimeout+proxyDispatcher(proxyUrl)— the standard outbound-fetch contract (上游长时间 prefill(首 token 前无输出)被 undici 默认 bodyTimeout=300s 掐断,UPSTREAM_TIMEOUT_MS=10min 配置形同虚设,大上下文请求必超时 #551 idle watchdog, direct-dispatcher fallback, manual redirects) used by every other bili call. Previously a rawfetchwith a hard 120 s total timer, bypassing the proxy entirely.error.type/error.message(when JSON) and the requested URL path (host never logged — mask discipline).SUMMARY_RETRY_COOLDOWN_MS); continues still forward fail-open meanwhile, success clears it. A broken session no longer re-uploads its transcript on every turn.tests/threads-lane.test.ts: the fake upstream now records request paths; the reforge test asserts the side call landed on/v1/messages(the regression net for [Bug][threads lane] reforge summary side-call always 404s: executeThreadsReforge receives the upstream origin instead of /v1/messages, compression never completes (0.1.198) | [Bug][threads lane] reforge 摘要 side-call 恒 404:executeThreadsReforge 收到的是上游 origin 而非 /v1/messages,压缩从未完成(0.1.198) #3569); new test pins the cooldown behavior (a second over-window continue within the window makes no second side call; the continue still forwards).Behavior changes (old → new)
https://api.anthropic.com)fetch, no proxyfetchWithTimeout+ proxy dispatcher, same decision as the main forwardsummary side-call failed (HTTP 404)error.type=…/error.message=…+ URL pathNo client-visible wire change beyond what the rollout already defines: the lane stays byte-faithful pass-through and fail-open in both modes; only bili's own internal side call changes.
Surface checks
kernel-change).tests/threads-lane.test.ts,tests/issue2701-threads-continue.test.ts— 14/14); typecheck clean. Full-suite verdict comes from CI on this head.Out-of-scope note flagged for owner decision: the threads budget window reads top-level
opts.modelContextLimit(src/server/prepare-anthropic.ts:107) while the rest of the anthropic prepare uses the route-resolved value — provider-levelcompress.modelContextLimittherefore does not reach the threads lane. Reported in #3569 as uncertain-if-intentional; left untouched here because it changes the reforge trigger threshold.