Skip to content

[PR] Gate completion: restart lane to add Anthropic line (Claude) + fix double-execution bug on P lane | gate 补全:重启车道加 anthropic 线(claude)+ 修 P 车道双重执行 bug - #6823

Merged
ranxianglei merged 3 commits into
masterfrom
2026-11-15_gate-coverage
Nov 15, 2026

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

gate 覆盖补全 + 修一个双重执行 bug

这是什么

  1. 修:R 车道进程(restart-lanes.mjs)启动时会因为一行 import 把整个 P 车道套件(plugin-lanes.mjs)在后台再跑一遍——两套 P 车道写同一批目录,并发跑的时候 npm 安装撞车(ENOTEMPTY)、pi 的 recorder 被杀(503)、退出码被污染。给 plugin-lanes.mjs 的 main() 加标准 import 守卫,一行判断,不改任何逻辑。
  2. 补协议:重启车道(R)新增 claude 车道——R 车道第一次覆盖 anthropic-messages 线(之前 R 只有 openai-chat 线:dsh+pi)。claude 走 prefix 车道:手动 bili 代理 + 杀代理矩阵(SIGTERM/SIGKILL)+ 重启后续传 + 压缩量断言 + 单实例断言。配置里 agentsR 加 claude 即启用(默认不开,因为 claude 小窗 preflight 慢,单条 ~8-10 分钟)。
  3. 补门:P 车道默认矩阵加 dsh-google(google-generative-ai 门从此每次 gate 都过)。

为什么要修

2026-11-15 的并发验证跑整体红,查下来全是这个双重执行 bug 的连锁反应,不是产品问题;而且它让之前所有容器化运行(含 43 分钟串行基线)都混入了影子 P 车道的耗时和负载。修完重跑,才能得到干净的串行/并发对比。

验证

  • 本地:node --check/bash -n/JSON 解析全过。
  • 待做(已计划):干净重跑一次并发 gate,确认 (a) restart-lanes.log 不再混入 plugin lane: 头,(b) npm/recorder 两类假红消失,(c) claude R 车道和 dsh-google P 车道本身绿。

文件

  • scripts/gate/plugin-lanes.mjs:import 守卫
  • scripts/gate/restart-lanes.mjs:claude 车道(setup/turn/窗口切换/杀代理矩阵/teardown)
  • scripts/gate/entrypoint.sh、scripts/gate/bili-gate.sh:默认矩阵 + dsh-google
  • scripts/gate/config.example.json、README.md、README.zh-CN.md:文档

ework-agent added 2 commits November 15, 2026 20:13
…ult matrix

Coverage follow-up (PR#6793 review, owner asked: 协议是否齐全/场景/客户端):

1) Lane R gains a claude agent (opt-in via agentsR): the first non-openai
   CLIENT-SIDE wire through the deep restart scenario. Prefix topology —
   claude-code speaks anthropic over HTTP to a harness-managed bili proxy
   child (-> recorder -> model); the small window is bili-side (provider
   context + proxy restart, prefix-lane rule) at 32768 (claude's
   unfoldable floor sits near the wall — Lane P lesson). Kill matrix:
   the proxy is killed via SIGTERM/SIGKILL and re-established on the SAME
   port by the harness (nothing auto-respawns a manually started proxy);
   each respawn must resume the session, outbound stays compact AND
   non-empty, exactly one live proxy (no split-brain). Every turn also
   gets the 600s budget (claude small-window preflight is a multi-stage
   distillation; the 300s budget SIGTERMs mid-preflight — Lane P lesson).

2) dsh-google joins the default Lane P matrix: the google-generative-ai
   client door now runs in every gate (the harness lane + wire assertions
   already existed; it just was never in the default set).

Also: restart-lanes setHostWindow is now async (the claude window flip
restarts the proxy and must complete before the next turn); the claude
proxy handle is hoisted to lane scope so teardown always reaps it; stale
duplicate comment removed.
…le-running the P suite

restart-lanes.mjs imports { buildCorpus, CODEWORDS } from plugin-lanes.mjs;
the unguarded top-level main() re-ran the whole P-lane suite inside the
restart-lanes process (GATE_AGENTS there = dsh,pi), in the SAME $WORK lane
dirs: two npm -g installs into one prefix -> ENOTEMPTY, a sibling pi
recorder killed via the shared instance registry (503 connect-refused on
pi t2-t4), and the side-effect suite's process.exit(1) became the R
process's exit code. Every containerized gate run since the in-repo move
was contaminated; the 2026-11-15 concurrent verification run's wall time
(39.5min) included doubled model load in the R phase.
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-15_gate-coverage (f69e0ad)

Latest build — install this exact version

npm install -g billion-context@0.0.10183-pr.6823.4edb402

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
f69e0ad billion-context@0.0.10183-pr.6823.4edb402 build
da2db8c billion-context@0.0.10180-pr.6823.61e0475 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr6823.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title [PR] gate 补全:重启车道加 anthropic 线(claude)+ 修 P 车道双重执行 bug [PR] Gate completion: restart lane to add Anthropic line (Claude) + fix double-execution bug on P lane | gate 补全:重启车道加 anthropic 线(claude)+ 修 P 车道双重执行 bug Nov 15, 2026
…ne (PR #6823)

The claude (anthropic-wire) lane landed in this PR but the file-header
protocol block still read "dsh headless, pi" / "Per agent (dsh, pi)" and
claimed the hostile mid-turn variant runs per agent (it is dsh-only in code).
Header now names claude, notes its R0/R1-only harness-re-established matrix,
and the GATE_R_CONC comment drops the stale "both agents" phrasing.
Comments only — no behavior change.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重: 不重复 —— 本线程只有 PR #6823 一个,本审核直接在该分支上进行,未开并行 PR。

这是 [PR] 任务,我没有重做工作:拉取分支逐行核代码、查 CI 状态、给出审核结论。

我验证了什么(审核过程)

  1. 双重执行 bug 与修复:restart-lanes.mjs:74 import { buildCorpus, CODEWORDS } 自 plugin-lanes.mjs,后者 main() 原本无守卫——import 即把整个 P 套件作为副作用跑起来,机制成立。修复是标准 entry guard(process.argv[1] 与 import.meta.url 匹配才跑 main),pathToFileURL 已在 import 列表里,process.argv[1] && 兜底也在。直接执行(entrypoint.sh node $PL)与 import(restart-lanes)两条路径语义分别核过,均正确。
  2. claude 车道:依赖的 helper 逐个验证——waitForExit/healthy/killProxy/liveInstance/reqMaxSince/MARK_RE(39)=S40 均存在且语义与用法吻合;claudeTurns 声明早于首次 turn() 调用(无 TDZ 问题);代理 detached 启动 + 进程组 kill,teardown 有回收;baseEnv 的 XDG 接线保证子代理读到 lane 本地 bili.json;kill 矩阵(SIGTERM/SIGKILL + 同端口重建)+ 续传 + 压缩量三明治断言 + 单实例断言,与 issue 声明范围一致(hostile host-kill variant 是 dsh-only,属既有设计,非回归)。
  3. dsh-google:bili-gate.sh、entrypoint.sh、config.example.json、README en/zh 五处同步,_doc_ 键约定与既有 _doc/_doc_keys 一致。
  4. 语法:node --check ×2、bash -n ×2、JSON 解析,全过。
  5. diff:7 文件全部在 scripts/gate/ 下,每一行都与 PR 目的相关;无产品代码、无 kernel、无 config schema、无 wire 变更。

顺手小修(已 push,独立 commit f69e0addd2):restart-lanes.mjs 文件头协议段仍写 "dsh headless, pi" / "Per agent (dsh, pi)",且声称 hostile variant 每 agent 都跑(代码里是 dsh-only)——注释与代码事实不符,已修正。纯注释,零行为变更。

标签:PR #6823 已打 ci + scope/ci + p3(按 PR 自身 diff 判定:gate/CI 基础设施,无产品用户面影响)。

CI 状态(实时查过):新 head f69e0addd2 运行中,当前无 failure(上一 head 的 gate lane 已绿;e2e lane 按路径过滤照常 SKIPPED)。

八问

  1. 是什么问题:R 车道进程启动时因 import 副作用把整个 P 车道套件在后台再跑一遍,两套 P 车道写同一批目录互相踩踏,产生假红(npm ENOTEMPTY、pi recorder 被杀 503、退出码污染);另 R 车道缺 anthropic 线、P 车道默认矩阵缺 dsh-google。
  2. 什么原因导致的:plugin-lanes.mjs 的 main() 无 import 守卫,而 restart-lanes.mjs 需要复用其 buildCorpus/CODEWORDS——import 即触发整套 P 套件执行。
  3. 影响范围与严重程度:只影响 gate 容器化验证跑(内部 CI),产品用户无影响;严重度中等——gate 假红无法区分真产品回归,且此前所有容器化运行(含 43 分钟串行基线)都混入影子 P 车道的耗时与负载,基线数据被污染。
  4. 怎么修复的:一行 entry guard(脚本作为入口才跑 main);R 车道新增 claude 车道(prefix 拓扑:harness 管理代理、杀代理矩阵 SIGTERM/SIGKILL、同端口重建、续传、压缩量三明治断言、单实例断言,agentsR 加 claude 启用,默认关);P 车道默认矩阵加 dsh-google。
  5. 是否有回归问题:逐项过既有行为——(a) plugin-lanes.mjs 直接执行:守卫保留直接执行语义,不变;(b) restart-lanes.mjs 的 import 行为:副作用消失,这正是被修的 bug,是唯一行为变更;(c) agentsR 默认仍是 dsh,pi,claude opt-in,默认跑行为不变;(d) P 车道默认矩阵 +dsh-google 为有意变更(issue 已披露,每次 gate 多跑一条车道)。无产品代码触碰。
  6. 是否破坏缓存:不涉及——未触碰任何缓存/重试/游标/去重键逻辑。
  7. 是否改了设计方向:不涉及——gate 基础设施加覆盖,无架构变化。
  8. 是否引入了新的配置:两处默认值变化——P 车道默认 agents 矩阵新增 dsh-google(bili-gate.sh/entrypoint.sh/config.example.json/README en+zh 五处同步);claude 车道经 agentsR 加 claude 启用、默认关,未引入新 env/config 键。

结论:代码干净、机制成立、方向正确——可合(待新 head CI 全绿)。issue 里计划的「干净重跑并发 gate」(真模型容器,~4-5h)仍待做,是修复的最终验收。

@ranxianglei
ranxianglei merged commit f648217 into master Nov 15, 2026
84 of 120 checks passed
@ranxianglei

Copy link
Copy Markdown
Owner Author

修复验证:干净重跑(并发模式,v0.1.215 + 修复分支 da2db8c,52min)

import 守卫修复后完整重跑了一次(6 个 P 车道 + dsh/pi 重启车道,并发),三类假红全部消失:

检查项 结果
restart-lanes.log 混入 plugin lane: 头(双重执行) 0 次 — 影子 P 套件不再运行
npm ENOTEMPTY 安装撞车(dsh 车道整条炸) 消失
pi recorder 被杀 → t2/t3/t4 全 503 connect-refused 消失,pi P 车道全绿
A / B / U / I / X 9/9 · 6/6 · 2/2 · 3/3 · 4/4 全绿
P:dsh / pi / codex / opencode 全绿
P:dsh-google(本 PR 新门) 按设计降级 CLIENT-BLOCKED:dsh 0.2.0-rc.2 的 provider 配置只认 openai-completions/openai-responses/anthropic-messages,零上游流量,整条不计分,dsh 支持 google 协议后自动转正
R:dsh t3 CONTEXT_WINDOW_EXCEEDED 仍发(11-03 起的老病,客户端估算溢出,与本次修复无关)
pi t3 / claude t2 exit 143 6 路并发下 turn 排队超 300s 预算,负载类

结论:并发 gate 的机制在干净环境下不产生假红,剩余红全部可归类为环境/负载/老病。claude 重启车道(本 PR 另一个特性)正在单独短跑验证中(agentsR=claude,只跑 R 车道),结果稍后补。

@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1209-master.f648217 (rolling master tag).

npm install -g billion-context@0.0.1209-master.f648217  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

This was referenced Nov 15, 2026
@github-actions github-actions Bot mentioned this pull request Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant