You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
现有 tests/side-request-isolation.test.ts:27 的 assert.equal(isSideRequest({ max_tokens: 8192 }), false, "normal budget is not a side request") 把「正常预算即主请求」这条假设固化成了期望行为,可以作为这个缺口的锚点。详细复现、A/B 端到端实验与两种修法见 #1307。
Activity
ranxianglei commentedon Aug 31, 2026
[bot] 🏷 收到,正在处理。已确认三处根因:
server.ts对每个转发请求(含侧请求)都调用rememberPluginMessages,acp_status 读的正是这份视图 → 被 title-gen 的小消息覆盖。prepareAnthropic没有isTitleGen短路,侧请求也走processTurn→assignRefs/advanceSurvival/stats.contextTokens全部被污染。snapshotMessages只在非空时覆盖 → 侧请求把主会话视图钉死,波及bili export与持久化记录。修复方案:统一识别侧请求(
max_tokens <= 200启发,与现有isTitleGen阈值一致),对其走纯透传——不processTurn、不rememberPluginMessages、不snapshotMessages、不采集 usage,内核状态完全不动。稍后提交 PR + 回归测试。ranxianglei commentedon Aug 31, 2026
[bot] 🏷 已修复,PR: #398
根因确认(与你取证一致):
rememberPluginMessages(...)对每个转发请求无条件执行,而acp_status读的正是这份"上次 prepare 视图"。processTurn(assignRefs / advanceSurvival)、重写session.stats.contextTokens(nudge 基线)、snapshotMessages。isTitleGen只守卫工具注入,从不守卫快照/状态。修复(src/server.ts):
isSideRequest(parsed):输出预算极小(max_tokens/max_completion_tokens/max_output_tokens≤ 200,与 prepareOpenai 的 isTitleGen 同阈值);缺失/非正数预算永不判为侧请求。handle()中,侧请求(非 count-tokens、非 responses-compact)走纯透传(forward传prepared=null):不processTurn、不快照、不采 usage、不改 stats、不rememberPluginMessages。主会话内核状态只由主请求驱动。回归测试 tests/side-request-isolation.test.ts:
isSideRequest单测(各协议字段名、边界 200/201、非对象/字符串/0/负数)。验收标准对照:
stats.inputTokens/lastInputTokens不再被 6-token 级侧请求覆盖(断言 lastInputTokens 保持主值)bili export视图不再被冻结旧快照钉住(断言 lastMessages 不变)pre-flight:typecheck clean、870/870 测试通过、build OK。E2E codex 套件本地跳过(环境无 codex 二进制 / 本地 Responses upstream),CI 会跑。
另注:
launcher-plugin-mode测试用了不真实的max_tokens:10(与新启发式冲突),已改为8192——这些测试验证的是绑定行为,不是预算处理。PR 待人工合并(CI 会在合并后自动发布)。
fix(#388): keep #460 tag strip for side requests via sidePassthrough …
ranxianglei commentedon Sep 4, 2026
修复在 PR #398,已完成二次 review 并彻底修复(review 评论:https://github.com/ranxianglei/billion-context/pull/398#issuecomment-5534842156)。
要点:原「纯透传(prepared=null)」方案会丢失 #460 的 title-gen 标签剥离(真实用户报告过的回归),现已改为最小 Prepared + sidePassthrough 标志 —— 侧请求仍走 strip 管道(响应卫生),但 preflight / fake-completion 重试 / compress loop / usage 采集全部跳过,内核状态零触碰。
四条验收(状态逐字节不变 / usage 不被覆盖 / export 视图不冻结 / 混合流回归测试)均由 tests/side-request-isolation.test.ts 钉死,1030/1032 全绿(仅 2 个已知环境失败)。等合并后随下一版本发布。
ranxianglei commentedon Sep 4, 2026
[bot] 🏷 已拉取最新分支(HEAD
8b88162,含 master 合并至 v0.1.82)并复核代码 + 本地跑通 pre-flight。方案确认:owner 的二次修订正确且必要。我最初的「纯透传(prepared=null)」确实会跳过 forward() 里的 #460 render-tag strip 管道——侧请求(标题生成)响应里若回显历史 render tag,会漏到客户端并经其重放放大,正是 review 抓到的回归。改为最小
Prepared { sidePassthrough: true, processedMessages: [], compressInjected: false }后:pipePluginChatWithStrip/pipePluginResponsesWithStrip/pipePluginJson,session=undefined → usage 采集关闭),响应卫生保住;!prepared.sidePassthrough守卫)、compress loop(processedMessages 空 → useRewriter=false)、usage sniffing 全部跳过;我的 pre-flight 结果:
tests/launcher.test.ts:715 resolveClientCommand: codex/claude resolve to themselves是环境问题(本环境无 codex/claude 二进制,PATH=/usr/bin 解析不到),与 标题生成等侧请求污染主会话状态:prepareAnthropic 缺 isTitleGen 守卫、快照无条件覆盖、survivedCount 每请求空转 #388 无关。标题生成等侧请求污染主会话状态:prepareAnthropic 缺 isTitleGen 守卫、快照无条件覆盖、survivedCount 每请求空转 #388 相关测试(tests/side-request-isolation.test.ts+ 被 bump 的小预算 fixture)全绿。四条验收(状态逐字节不变 / usage 不被覆盖 / export 视图不冻结 / 混合流回归)均由
tests/side-request-isolation.test.ts钉死,复核通过。可合并;CI 会在合并后随下一版本自动发布。ranxianglei commentedon Sep 4, 2026
已随 PR #398 修复并发布在 v0.1.83(npm 已验证)。
最终方案(在原 PR 基础上重做):侧请求不再走
prepared=null纯透传,而是构造最小 Prepared 并标记sidePassthrough: true——渲染标签剥离管道照常运行(#460 契约保持:标题生成流回显的<acp>标签仍会被剥),同时 fake-completion 重试显式跳过、压缩循环永不进入、内核状态零污染。预检:typecheck ✅,npm test 1030/1032(2 个已知环境失败,基线不变),build ✅。
如在新版本上仍能复现污染,请重开并附日志。
fix: isolate side requests (title-gen) from main session kernel state (…
fix: tool-carrying main requests with a client-starved output budget …
fix: judge anonymous zero-baseline forks by the char-count upper bound (
fix: guard side requests against over-window payloads (ranxianglei#554)
LessXi commentedon Sep 25, 2026
关联补充:#1307
#388 / PR #398 的侧请求隔离(
isSideRequest(),判据为「输出预算 ≤ 200」)在同族问题上仍然有一个缺口,在这里补一条链接:tools、单条合成 user 消息)声明正常输出预算(本例是宿主 DSH auto-review 的审查请求,经dsh-llm兜底后 wire 上是max_tokens: 384000)。这类请求isSideRequest()判false,于是 标题生成等侧请求污染主会话状态:prepareAnthropic 缺 isTitleGen 守卫、快照无条件覆盖、survivedCount 每请求空转 #388 的隔离整条分支不进入。processTurn/snapshotMessages,然后src/server.ts:2187-2189无条件把它 1 条消息的视图写进remembered;紧接着执行的compress从remembered读锚点(src/plugin.ts:885-886),可见消息集只剩 1 条 ⇒ 所有旧 ref 判为悬空 ⇒Requested range(s) cannot be anchored。生产日志里 plugin 路径 225 次压缩尝试呈完全决定论:ctx == 1时 163/163 失败,ctx > 1时 62/62 成功。rememberPluginMessages)。PR fix: isolate side requests (title-gen) from main session kernel state #398 让侧请求不再走到那里,但没有在写入点本身设防——所以判据一旦漏掉某种形状,污染就会原样回来。现有
tests/side-request-isolation.test.ts:27的assert.equal(isSideRequest({ max_tokens: 8192 }), false, "normal budget is not a side request")把「正常预算即主请求」这条假设固化成了期望行为,可以作为这个缺口的锚点。详细复现、A/B 端到端实验与两种修法见 #1307。fix: guard rememberedPluginMessages against side-shaped snapshot evic…
19 remaining items
test: pin the #4974 side-lane arming contract in the dedicated invari…
fix: recognize the claude code title sidecar so it never claims the r…
fix: correct #388 side-passthrough rationale in restart-survival test…
fix: generic dsh single-shot sidecar gate — stop unknown sidecars fro…
fix(hermes): align the ranxianglei#5073 side-call fix with ranxiangle…
#5608-B: honest-NULL arms only where identity is PROVEN (fix #554 sta…
test(#554): pin the honest-NULL poison field in the side-request isol…
fix(v1internal): reword bypass comment to not trip the #2170 lane-gua…
fix(v1internal): reword bypass comment to not trip the #2170 lane-gua…
fix(hermes): align the ranxianglei#5073 side-call fix with ranxiangle…
fix(ranxianglei#5687): a tool-less MAIN turn must not be mistaken for…
fix(v1internal): reword bypass comment to not trip the #2170 lane-gua…
fix(openai): route tool-less audio (TTS) requests through the side pa…
dsh purpose: stop guessing which requests are auxiliary — the plugin …
fix(pi): declare every pi dispatch as the session's main conversation…