Skip to content

[PR] fix: name the textRunThreshold knob in the text-run trip log - #5061

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-10-29_textrun-trip-hint
Open

ranxianglei wants to merge 1 commit into
masterfrom
2026-10-29_textrun-trip-hint

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #5036

What & why

Gemini-family models legitimately emit long runs of identical codepoints (blank-line padding) in their VISIBLE text. The output-side single-codepoint repetition guard (src/runaway-guard.ts, #3260/#3946) trips at the 200 default and aborts the whole turn mid-stream — but the trip log never named the escape hatch, so there was no discoverable way to raise or disable it. This implements fix option C from #5036 (the no-decision-dependency part).

Changes

  • RunawayVerdict.detail now carries textRunThreshold — the value THIS guard instance actually enforced — so the log reports the effective setting instead of making the operator guess.
  • New exported textRunTripHint(verdict) appends an operator-facing remediation to a text-run trip: the knob name (guardrails.textRunThreshold), the env override (BILI_GUARDRAIL_TEXT_RUN_THRESHOLD), the enforced value, and that 0 disables the lane. Returns "" for the other two lanes (acp-enumeration, tool-xml-flood), which have no user-facing knob.
  • Both trip-log sites in src/server/relay.ts (plugin stream + proxy stream) now include the hint.
  • CLIENTS.md documents the pitfall in the Gemini-family/Antigravity section.
  • 5 regression tests in tests/issue3260-text-run-guard.test.ts (detail field default/env/near-miss; hint positive + negative-direction for the other two lanes).

Behavior change (disclosed)

The diagnostic log line for a text-run trip now appends [legit long same-char output? raise guardrails.textRunThreshold / BILI_GUARDRAIL_TEXT_RUN_THRESHOLD above <N> (0 disables this lane)] before "— aborting upstream stream". Old → new: the line previously ended at the detail JSON; it now adds the hint. Additive only — the original content is preserved. No change to guard trip logic, thresholds, defaults, wire shape, persistence, or any config schema (this READS the existing guardrails.textRunThreshold knob; it adds no new config field).

Config surface

None added. This surfaces an EXISTING knob (guardrails.textRunThreshold, added by #3406 item 1); no new field, rename, or re-semantics.

Out of scope (awaiting owner decision)

Fix option B (per-provider/model-family threshold override, e.g. a higher default on Google lanes) is a config-surface change and needs sign-off before build per Configuration Surface Discipline — proposed in the #5036 thread, not implemented here. Option A (raise the global 200 default) was rejected in the issue as weakening #3946's symbol-loop protection.

Verification

Local: node --import tsx --test tests/issue3260-text-run-guard.test.ts → 30/30 pass; npm run typecheck clean. Full-suite verdict = remote CI on this head.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-29_textrun-trip-hint (b066e45)

Latest build — install this exact version

npm install -g billion-context@0.0.10259-pr.5061.f5d4f0f

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
b066e45 billion-context@0.0.10259-pr.5061.f5d4f0f build
98e2a9e billion-context@0.0.9228-pr.5061.5746e4c build
e8daaa2 billion-context@0.0.7415-pr.5061.16833e8 build
99cba89 billion-context@0.0.7249-pr.5061.2456eda build
960ea46 billion-context@0.0.7128-pr.5061.30d3037 build
d632ec0 billion-context@0.0.7093-pr.5061.8259405 build
fc31304 billion-context@0.0.6894-pr.5061.10900ad build
75ca8da billion-context@0.0.6693-pr.5061.037c2e1 build
f9a7911 billion-context@0.0.6665-pr.5061.c723da9 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

重启后进度汇报(此前两次卡住无产出,现已恢复并定位完毕):

红腿诊断:test (ubuntu-latest, 24, 2) 唯一失败 = tests/wire-exit-matrix.test.ts 的 abort x proxy-anthropic-sse: client abort mid-stream destroys the upstream request,断言 upstream socket(s) destroyed after client abort (closed=0),duration 3715ms。这是 #4599 在档的 abort-teardown flake 家族(慢 runner 上 abort→上游 teardown 异步传播超过测试的 3s 轮询预算;同 run 内三个兄弟 cell openai/responses/json 全过、其余 3590/3605 全绿)。本 PR diff(runaway-guard 日志字段 + relay 两处 trip log + CLIENTS.md)与该路径零交集,非继承(master 红在 release 车道,与本分片无关)、非自因。

处置中:按在档同法(#4683/#5004/#5009 先例)把该测试族四个 abort 用例的轮询预算 3s→6s,独立标注 commit 推进本 PR 分支并重跑;完成即报结论。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复——按失败签名检索 open+closed issue/PR(textRunThreshold / text-run trip log):相关项仅 #5036(本 PR 的母 issue)、#3411(closed,#3406 交付的旋钮本体)、#3534(closed release);无在途同签名 PR。本 PR 是 #5036 方案 C 的落地,与 #3358(EXCLUDED_BRANCHES 误计数)、#3411(旋钮)机制层不同,#5036 已逐一甄别。

标签: bug / antigravity / gemini / scope/wiring / p3(理由:PR 本身只改诊断日志行 + CLIENTS.md + 回归测试,纯增量;母 issue #5036 保持 p2 直到方案 B 落地)。

当前状态(接手说明):

有结论即回本线程(八问体例)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

进度汇报(会话曾因网络挂起被重启数次,现恢复):

已完成的核验(不依赖 git 拉取,走 npm registry——代理通道故障期间直连可用):

  • 从 npm 拉到本 PR 的构建产物 billion-context@0.0.6665-pr.5061.c723da9(build-info commit c723da9,与 floor 1 构建表一致),在 bundle 内逐项核对了 PR 声称的三处代码改动,均属实且与描述一致:
    1. createRunawayGuard() 的 detail() 现在携带 textRunThreshold(guard 创建时经 guardrailTextRunThreshold() 解析的实际生效值);
    2. 新增导出 textRunTripHint(v):仅 text-run 车道返回提示串 [legit long same-char output? raise guardrails.textRunThreshold / BILI_GUARDRAIL_TEXT_RUN_THRESHOLD above <生效值> (0 disables this lane)],其余两车道(acp-enumeration/tool-xml-flood)返回 "";detail 缺字段时显示 ?;
    3. relay 两个 trip-log 位点(plugin 流 + proxy 流)均为 …${JSON.stringify(detail)}${hint} — aborting upstream stream,纯追加,原内容保留。
  • 提示串引用的旋钮名与 CONFIGURATION.md 既有文档(guardrails.textRunThreshold / BILI_GUARDRAIL_TEXT_RUN_THRESHOLD,区间审查(#3331)残留 11 项中小问题集中修:守卫旋钮、存储竞态、静默丢参、CI 触发残角等 #3406 交付)完全对得上,无新配置面。

进行中:

@ranxianglei
ranxianglei force-pushed the 2026-10-29_textrun-trip-hint branch from f9a7911 to 75ca8da Compare October 29, 2026 01:54
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

PR Review 结论:可合 ✅(已 rebase 到当前 master,CI 全绿)

独立审核完成——自己读了全量 diff(4 文件,+90/-3)、核对了 npm build-artifact(dist/index.js 内 detail 字段、textRunTripHint 定义与两处 relay 调用点均在位)、本地定向跑了相关测试、并对 CI 红腿做了取证。未照抄 issue 侧结论。

方向关:#5036 的机制是「trip 日志不命名逃生旋钮 → 操作者无从发现」,本 PR 在正确的层(诊断/日志面)修根因:把本实例实际生效的阈值写进 verdict detail,并在两条车道的 trip 日志追加命名了 knob/env/生效值/0=禁用的补救提示。选项 C(无决策依赖部分)实现完整;B(config 面变更,按 Configuration Surface Discipline 等 owner 拍板)与 A(issue 内已否决)正确留在 scope 外。披露的行为变更与实际 diff 逐字一致。

回归清点(改动前代码逐项过):

  • RunawayVerdict.detail 新增可选字段——master 上该字段的全部消费者只有 relay.ts:1755/:2050 两个日志点(grep 确认无 panel/status/其他消费方),加字段零波及;
  • 非 text-run 车道(acp-enumeration/tool-xml-flood)hint 返回 "",日志行与改前字节一致;
  • guard 判定逻辑、阈值、默认值、wire 形状、持久化、config schema 均未触碰;CLIENTS.md 为纯增量段落且内容准确(Gemini-family 空行填充 ≥200 \n 触发、knob/env/0 禁用、指向 CONFIGURATION.md)。

结构化八问:

  1. 是什么问题:Gemini 家族模型合法输出长同字符段(空行填充)时,text-run 守卫在默认 200 处掐断整轮,但 trip 日志从不命名逃生旋钮,操作者没有可发现的方式调高或禁用它。
  2. 什么原因导致的:诊断面缺失——日志只报观测值(maxTextRun/textRunChar),不报本次实例实际执行的阈值,也不提示存在 guardrails.textRunThreshold / env 覆盖这条逃生路径(区间审查(#3331)残留 11 项中小问题集中修:守卫旋钮、存储竞态、静默丢参、CI 触发残角等 #3406 加了旋钮但没接进日志)。
  3. 影响范围与严重程度:仅诊断可发现性——受影响的是一次被误伤掐断后排查的操作者(Gemini/Antigravity 车道);不改任何运行行为。p3。
  4. 怎么修复的:verdict detail 携带本实例生效阈值(闭包变量,创建时解析一次);新增导出 textRunTripHint(verdict) 仅对 text-run 车道生成操作者提示(含生效值,缺省显示 ?),两处 trip 日志(detail JSON 与 "— aborting upstream stream" 之间)插入;文档补 Gemini 段落。
  5. 是否有回归问题:无。既有行为逐项判定见上;高危模式(语义漂移/fail-fast 变吞错/阈值时序漂移/输出格式变化)均不适用——唯一变化是 text-run trip 日志行的附加文本,且已在 PR 描述披露旧→新。小观察(非拦阻):hint 内容本身有测试钉住,但「两处 relay 站点都插入了 hint」这一行级事实靠人工/bundle 核验而非测试钉住(relay 级集成测试需完整流 mock,超出本 PR 合理范围);若未来有人删掉其中一处插入,现有测试抓不住——可接受的低风险残留。
  6. 是否破坏缓存:不涉及(未触碰缓存/重试/游标/去重任何路径)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:无。只读取既有 guardrails.textRunThreshold(env BILI_GUARDRAIL_TEXT_RUN_THRESHOLD,区间审查(#3331)残留 11 项中小问题集中修:守卫旋钮、存储竞态、静默丢参、CI 触发残角等 #3406 引入);无新字段/改名/改语义。

CI 处置记录:原 head f9a7911 那轮唯一红腿 test (ubuntu-latest, 24, 2) 经取证判定为继承性/环境问题(同分片文件集的 node22 腿绿、windows 5 片全绿、PR diff 为纯日志附加不可能产生 node24 专属失败;日志 API 404 拿不到明细)——分支落后 master 18 个提交(mergeable_state=behind),已 rebase 到当前 master 5594c13(新 head 75ca8da,单提交线性历史,无冲突),重跑 CI:36 success / 14 skipped(重型 e2e 门控跳过)/ 0 failed,含此前红腿。取证签名已按 CI 协调规则报到 #4599(哨兵自 18:21Z 起停摆,留给其后续核对)。

§7.4 自动合并门:全部满足(单模块 fix、回归测试在位、rebased head 全绿、无 config/persistence/wire/kernel 变更、纯 fix、diff 干净、Fixes #5036、不碰承重基建)。建议直接合入;选项 B 留待 owner 另行拍板,不阻塞本 PR。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

状态确认(会话重启后复核):审核工作已全部完成,无未决项。PR 仍开放、head 75ca8da、CI 全绿(36 success / 14 gated-skip / 0 failed)。master 又前进了 4 个提交(至 6b298c3),经 compare 核验均未触碰本 PR 的 4 个文件——diff 对当前 master 仍是那一个干净提交,「behind」仅为 base sha 陈旧,不产生任何冲突或语义影响,无需再 rebase。结论维持上一条八问回复:可合入,等人工合并即可;选项 B(per-provider 阈值覆盖)仍按 Configuration Surface Discipline 等你拍板,不阻塞本 PR。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

merge-guard sync done: merged origin/master 09a5b5b77 into 2026-10-29_textrun-trip-hint → new head fc313040d (zero conflicts — master touched none of this PR's 4 files); state after push: open, mergeable=true, no longer behind (base now at master tip), CI running on the new head with 0 failed (test shards still queued).

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: sglang-gpu0/qwen3.8-27b)

合并前复核(head 99cba8904,2026-10-31)

回归测试已随 PR 提交(5 项:detail 字段默认/env/临界值 + hint 正反向)。等人工审阅后即可合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

synced master e19386182 (#5236 message-timestamps + 120 more commits) into the branch — clean auto-merge (master touched src/server/relay.ts in a disjoint region: import line ~28 and systemPrompt line ~2096 vs this PR's runaway-guard import and two trip-log lines; both sides verified present in the merged tree), pushed as e8daaa293; state after push: open, mergeable=true, not behind (base at master tip), CI 0 failed / 9 pending.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

复核结论有效,补一个时效更新:该评论针对的 head 99cba8904 已被我随后推的同步合并取代——现 head 为 e8daaa293,已包含 master 最新 e19386182(落后 121 提交的问题已消除,mergeable=true)。净 diff 结论不变:同步只带入 master 自身提交,relay.ts 两侧改动区域不相交(master 动 importL28/systemPromptL2096,本 PR 动 runaway-guard import 与两处 trip-log),4 个功能文件范围未变。CI 正在新 head 上跑(0 failed / pending),全绿后即可人工合并。

@ranxianglei
ranxianglei force-pushed the 2026-10-29_textrun-trip-hint branch from e8daaa2 to 98e2a9e Compare November 12, 2026 02:12
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge conflict resolved and pushed. The PR branch was rebuilt cleanly onto current master and force-pushed (e8daaa2937… → 98e2a9e305). mergeable_state is now blocked (was dirty) — i.e. the conflict is gone; it's only waiting on CI + approval. Live mirror cache on the new head: 0 failed / 11 pending (the test shards are still running; static-gates, docs-coverage, architecture-docs, plan, mysql-contract all green). No red CI to fix this run.

What I did, in short: a naive git merge origin/master exploded into 50+ conflicts across unrelated files because the branch carried a stale old-master snapshot from prior sync rounds. The PR's real content is only the 4-file fix (proven via GitHub /files + a name-only set-diff). So instead of hand-resolving 50+ files, I reproduced that one fix commit on top of current master (checkout -B to c26c31a + cherry-pick 75ca8daf) and force-pushed — functionally a conflict-rebase, which this task explicitly authorized. The only cherry-pick conflict was CLIENTS.md, caused by the 2026-11-08 docs-layout move (see Q4).

Local verification before pushing: npm ci clean, npm run typecheck exit 0, targeted tests/issue3260-text-run-guard.test.ts 30/30 pass, npm run build exit 0 (build-info 98e2a9e305).

八问

  1. 是什么问题:PR [PR] fix: name the textRunThreshold knob in the text-run trip log #5061 与 base 分支(master)产生合并冲突(merge state=dirty),无法合并。
  2. 什么原因导致的:该分支历史上叠加了多轮 master/ci-fixes 同步合并,携带了一份过期的旧 master 快照;直接 merge 当前 master 会在 50+ 个无关文件(AGENTS.md、CHANGELOG、README、.github/workflows、website、大量测试)上爆发冲突。而经 GitHub /files 与 name-only 集合差集证明,PR 的真实内容其实只有 4 个文件。
  3. 影响范围与严重程度:仅影响本 PR 的合并能力(被冲突卡住、无法 merge),不影响任何已发布行为;属「合并受阻」,非运行期缺陷。
  4. 怎么修复的:不逐文件硬解 50+ 冲突,而是把 PR 唯一内容(4 文件修复)干净地重建到当前 master 之上——git checkout -B 到 master tip(c26c31a)+ cherry-pick 真正的修复 commit(75ca8daf)。cherry-pick 仅 CLIENTS.md 冲突:master 已按 2026-11-08 文档布局决定把 CLIENTS.md 移动到 docs/clients.md 并留 redirect stub,而修复改的是旧 CLIENTS.md。解法:保留 CLIENTS.md=stub,把 +14 行段落落到 docs/clients.md 同一锚点,并顺带把段落里过期的 CONFIGURATION.md → Parameter Reference 交叉引用改成指向 configuration.md#parameter-reference(同为 stub 迁移)。用确定性 Python 拼接插入,零字节副作用,diff 收敛为纯 +14 行。
  5. 是否有回归问题:无。代码侧 relay.ts/runaway-guard.ts/新测试均干净 cherry-pick(与 master 无冲突);修复本身是纯诊断(guard 触发逻辑与阈值默认值零改动)。本地 typecheck ✓、目标测试 30/30 ✓、build ✓。文档侧仅段落迁移 + 交叉引用对齐,无内容丢失。
  6. 是否破坏缓存:不涉及(无缓存/重试/游标/去重键改动)。
  7. 是否改了设计方向:不涉及(无架构/边界/数据流转向)。
  8. 是否引入了新的配置:不涉及(修复只是把已有旋钮 guardrails.textRunThreshold + env BILI_GUARDRAIL_TEXT_RUN_THRESHOLD 的名字打进 trip 日志,未新增任何配置项)。

判定:冲突已解决、已推送、本地验证全绿、CI 无红(运行中)。收工,等待 CI 分片跑完与审批;若后续 test 分片变红由本车道继续跟进。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

重启后进度汇报 + 独立 review 结论:可合 ✅(head 98e2a9e305,CI 全绿)

此前会话因网络挂起被重启,本轮已恢复并完成对当前 head 的独立审核(没有照抄 issue 侧或前几轮结论——自己重读了全量 diff、逐点核对了消费方/锚点/测试/CI):

审核对象与状态

  • 分支已按 floor 92 重建到当前 master tip(c26c31ace4)之上,单提交 98e2a9e305,落后 master 0 个提交(merge-base 即 master tip);净 diff = 4 文件 +91/−3:src/runaway-guard.ts、src/server/relay.ts、docs/clients.md、tests/issue3260-text-run-guard.test.ts。
  • CI(镜像缓存,该 head 最终态):16 success / 14 gated-skip / 0 failed / 0 pending;mergeable_state=blocked 仅指等审批,非冲突。

方向关(①):#5036 的机制是「text-run 守卫触发日志不命名逃生旋钮 → 操作者无从发现」,issue 明确推荐 C(无决策依赖)先行、B(按 provider/模型族阈值覆盖,配置面变更)等拍板。本 PR 精确落地 C:detail 携带本实例生效阈值 + 两条车道 trip 日志追加命名 knob/env/生效值/0=禁用的提示 + 文档记坑;B 正确留在 scope 外、A 按 issue 已否决。方向正确,scope 纪律遵守。

回归清点(②,改动前代码逐项过)

  • RunawayVerdict.detail 的全部消费方 = relay.ts 两处 trip 日志(JSON.stringify),grep 确认无 panel/status/持久化/其他消费方;
  • 一处披露精度补充:PR 描述说「另两条车道日志行字节一致」——严格说 hint 对它们确实返回 "",但 detail() 是三条车道共用的闭包,所以 acp-enumeration/tool-xml-flood 的 trip 日志里 detail JSON 也会多出 "textRunThreshold":<N> 字段。纯诊断增量、无任何解析方,不构成回归,但行为变更披露按旧→新口径应把这条也算上(旧:JSON 无该字段;新:有);
  • guard 判定逻辑(feedText 在 textRun >= textRunThreshold 触发、0=关)、阈值解析(区间审查(#3331)残留 11 项中小问题集中修:守卫旋钮、存储竞态、静默丢参、CI 触发残角等 #3406 每 guard 实例创建时解析一次)、wire 形状、持久化、config schema 均未触碰;
  • 文档侧:CLIENTS.md 在 master 上已是 redirect stub(2026-11-08 文档布局迁移),段落正确落到 docs/clients.md 的 Gemini 系/Antigravity 锚点(antigravity 描述之后、"None of the four has a native mode" 之前),交叉引用 configuration.md#parameter-reference 锚点存在(configuration.md:58),段落事实(200 默认、两条 Google 车道、knob/env/0=关)与 knobs.ts/configuration.md 在档一致。

代码审查(③):textRunTripHint 仅 reason === "text-run" 时返回提示,其余返回 "";eff 缺字段时显示 ? 是防御性兜底(text-run trip 必然来自 feedText,而 feedText 的 trip 结果必带 detail(),实践中不可达);提示串前导空格使日志读作 …(text-run; {...}) [legit …] — aborting upstream stream,格式正确;两处插入点(plugin 流 relay.ts:2276 / proxy 流 relay.ts:2596)与注释中「dump twin 在 guard 之后」的既有顺序关系不受影响。

测试有效性(④):5 个新测试都有牙——默认 200 进 detail / env 1000 进 detail / near-miss(180)不触发但 detail 仍带阈值 / hint 含 knob+env+生效值+「0 disables」/ 另两条车道 hint 为空(负向,符合 #3617 双向断言纪律)。已知残留:「两处 relay 站点都插入了 hint」这一行级事实无测试钉住(relay 级需完整流 mock,超出本 PR 合理范围)——若未来有人删掉其中一处插入,现有测试抓不住;低风险可接受。

diff 整洁度(⑤/⑤b):单提交、4 文件、每行都与目的相关;命名达意、无死代码、无魔法数字(测试用 TEXT_RUN_THRESHOLD 常量)、注释讲为什么、风格与文件一致、无新依赖。

结构化八问

  1. 是什么问题:Gemini 系模型合法输出 200+ 连续 \n(空行填充)时 text-run 守卫掐断整轮,但 trip 日志从不命名逃生旋钮,操作者没有可发现的方式调高或禁用它。
  2. 什么原因导致的:诊断面缺失——日志只报观测值(maxTextRun/textRunChar),不报本实例实际执行的阈值,也不提示 guardrails.textRunThreshold/env 这条逃生路径的存在(区间审查(#3331)残留 11 项中小问题集中修:守卫旋钮、存储竞态、静默丢参、CI 触发残角等 #3406 加了旋钮但没接进日志)。
  3. 影响范围与严重程度:仅诊断可发现性——一次被误伤掐断后的排查体验(Gemini/Antigravity 车道);不改任何运行行为。p3。
  4. 怎么修复的:verdict detail 携带本实例生效阈值(创建时解析一次的闭包变量);新增导出 textRunTripHint 仅对 text-run 车道生成操作者提示;两处 trip 日志在 detail JSON 与 "— aborting upstream stream" 之间插入;文档在正确锚点记坑。
  5. 是否有回归问题:无。高危模式逐项过:无语义漂移、无 fail-fast 变吞错、无阈值/时序/输出格式变化(用户可见输出不变,仅错误日志更详细);唯一行为变化是 trip 日志行增量(text-run 车道加 hint,另两条车道的 detail JSON 加字段),均属诊断增量且已在 PR 描述披露(披露精度见上补充)。
  6. 是否破坏缓存:不涉及(未触碰缓存/重试/游标/去重任何路径)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:无。只读取既有 guardrails.textRunThreshold(env BILI_GUARDRAIL_TEXT_RUN_THRESHOLD,区间审查(#3331)残留 11 项中小问题集中修:守卫旋钮、存储竞态、静默丢参、CI 触发残角等 #3406 引入);无新字段/改名/改语义。

§7.4 自动合并门:全部满足(单模块 fix、回归测试在位、rebased head 全绿、无 config/persistence/wire/kernel 变更、纯 fix、diff 干净、Closes #5036、不碰承重基建)。

一个非拦阻的流程观察:Closes #5036 会在合并时自动关闭母 issue,而 B 方案(按 provider/模型族阈值覆盖)的拍板正在 #5036 线程里征询——合并后该线程冻结,B 的决策记录会留在已关闭 issue 里。若你仍要推进 B,建议把 PR 的 Closes 改为 References(或 B 另立跟踪);若认为 C 交付即闭环、B 另找地方跟,则按现状合入即可。此点由你定,不阻塞。

判定:可合入,等人工合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Status update — my process was force-restarted after the previous run had already completed; re-verifying live now (not from memory), per status-freshness rules.

  • Conflict already resolved & pushed (prior run): branch rebuilt onto current master (c26c31a) + the single fix commit (75ca8daf), force-pushed as 98e2a9e305. The full 八问 write-up was posted just before the restart.
  • Re-verified in this run: local HEAD = remote PR head = 98e2a9e305, working tree clean. Nothing was lost to the restart.
  • CI is now fully green (mirror cache, fetched 03:08 UTC): total 30 → 16 success / 14 skipped / 0 failed / 0 pending. The 11 test shards that were still running when I last checked have all passed. (The 14 skipped are the gated e2e lanes whose own skip-gates don't fire for this PR's file set — expected, not failures.)
  • mergeable_state = blocked (was dirty) — the merge conflict is gone; it's now only waiting on human approval / branch protection, not CI.

No blocker, no red CI to fix. The PR is ready to merge pending a human approval. Nothing further for this lane.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

1 similar comment
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

Gemini-family models legitimately emit long runs of identical codepoints
(newline padding) in visible text; the output-side text-run guard trips at the
200 default and cuts the turn mid-stream, but the trip log never named the
escape hatch, so users had no discoverable way to raise or disable it.

- RunawayVerdict.detail now carries textRunThreshold (the value this guard
  instance actually enforced), so the log reports the effective setting.
- New exported textRunTripHint() appends an operator-facing remediation to a
  text-run trip (knob + env override + enforced value + 0 disables); empty for
  the other two lanes, which have no user-facing knob.
- Both relay.ts trip-log sites (plugin + proxy streams) now include the hint.
- CLIENTS.md documents the pitfall in the Gemini-family/Antigravity section.

No change to guard trip logic or threshold defaults; only the diagnostic log
line gains the hint (additive) and detail gains one optional field.
@ranxianglei
ranxianglei force-pushed the 2026-10-29_textrun-trip-hint branch from 98e2a9e to b066e45 Compare November 15, 2026 21:00
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Re-resolved the conflict (again) and pushed. This trigger re-fired because master advanced since my previous fix: the base moved c26c31a → f648217c (a 507-file wave — batch5-wave5 + release v0.1.214 + many PRs), which re-created the merge conflict. I re-rebased the 4-file fix onto the new master and force-pushed (98e2a9e305 → b066e451).

  • Only src/server/relay.ts conflicted: master added releaseNudgeHold, rejectNudge to the session import on the line adjacent to my textRunTripHint import. Resolved as the union of both. src/runaway-guard.ts auto-merged — my textRunThreshold/textRunTripHint now coexist with master's stream-guard refactor (iterative collectText, sticky NDJSON, regex re-anchor).
  • Local verification green on the new head: typecheck ✓, targeted issue3260-text-run-guard.test.ts 30/30 ✓, build ✓.
  • Live: mergeable_state flipped dirty → blocked (conflict gone; now awaiting CI + approval). CI on the new head is re-running (mirror cache hasn't refreshed to b066e451 yet).

⚠️ Why this keeps re-firing (1/3 → 1/6): master is very active, so every time it advances this PR (based on an older master) goes dirty again. The fix is small and already green — merging it soon will stop the churn. No design decision needed; this was a mechanical rebase.

八问

  1. 是什么问题:PR [PR] fix: name the textRunThreshold knob in the text-run trip log #5061 再次与 master 冲突(merge state=dirty)——因为 master 在我上次修复后又前进了。
  2. 什么原因导致的:base 从 c26c31a 前进到 f648217c(507 个文件的大波:batch5-wave5 + release v0.1.214 + 大量 PR),其中改动了本 PR 也改的 src/runaway-guard.ts 和 src/server/relay.ts,于是基于旧 master 的 PR 重新变 dirty。这是反复触发(1/3→1/6)的根因:master 持续前进,PR 不断落后。
  3. 影响范围与严重程度:仅本 PR 的合并能力(被冲突卡住),不影响任何已发布行为;属「合并受阻」,非运行期缺陷。
  4. 怎么修复的:把 4 文件修复重新 cherry-pick 到新的 master(f648217c)之上。仅 relay.ts 冲突——master 在我 textRunTripHint 导入行的相邻行给 session 导入加了 releaseNudgeHold, rejectNudge,按「两者并集」解决。runaway-guard.ts 自动合并,我的 textRunThreshold/textRunTripHint 与 master 的流守卫重构共存。--force-with-lease 推送(推送前已确认远端 head 未变)。
  5. 是否有回归问题:无。修复本身是纯诊断(guard 触发逻辑与阈值默认值零改动);新 head 上 typecheck ✓、目标测试 30/30 ✓、build ✓。冲突解决是「并集」,既保留 master 的新改动也保留本修复,无任一方丢失。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及(仍是把已有旋钮 guardrails.textRunThreshold + env BILI_GUARDRAIL_TEXT_RUN_THRESHOLD 的名字打进 trip 日志)。

判定:冲突已再次解决并推送(b066e451),本地验证全绿,mergeable_state dirty→blocked(待 CI + 审批),新 head 的 CI 正在重跑。建议尽快合并以停止反复 rebase 的 churn。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Review 判定:APPROVE ✅(head b066e451)

(bot 账号与 PR 作者为同一账号,GitHub 不允许作者对自己的 PR 提交正式 review,故以评论形式给出 review 结论,等效 APPROVE review。)

本轮是对 rebase 后新 head 的独立复核(master 于 11-15 前进到 f648217c,507 文件大波含 runaway-guard 流守卫重构;ci-engineer-r1 已按 floor 106 解冲突重推)。未照抄前轮结论——在新 head 上重读了全量 diff 与合并后代码:

复核要点

  • 净 diff 仍是 4 文件 +91/−3(src/runaway-guard.ts、src/server/relay.ts、docs/clients.md、tests/issue3260-text-run-guard.test.ts),内容与已审版本逐字同构;rebase 唯一冲突(relay.ts 导入行,master 同侧加了 releaseNudgeHold, rejectNudge)按并集解决,正确;
  • runaway-guard.ts 与 master 流守卫重构(iterative collectText / sticky NDJSON)自动合并后逐点验证:detail() 闭包仍携带 textRunThreshold、阈值仍每 guard 实例创建时解析一次(区间审查(#3331)残留 11 项中小问题集中修:守卫旋钮、存储竞态、静默丢参、CI 触发残角等 #3406 语义保持)、feedText 触发逻辑(textRun >= textRunThreshold,0=关)零改动、textRunTripHint 实现不变;
  • relay.ts 两处 trip 日志位点(新 head :2341 plugin 流 / :2672 proxy 流)均正确插入 ${textRunTripHint(v)},与 【bug2】plugin lane 缺失流终止可观测性:dumpSse 不生效 + 拿不到原始响应字节,静默停止无法定案 #2347 dump tee 的先后关系不受影响;
  • CI(该 head 最终态,单次 API 拉取确认——镜像缓存当时未刷新):38 success / 14 gated-skip / 0 failed / 0 pending;mergeable_state=blocked 仅等审批,非冲突;
  • 无 kernel/ 触碰、无 kernel-change 声明、无新配置面;PR 正文 Closes #5036 在位。

结构化八问

  1. 是什么问题:Gemini 系模型合法输出 200+ 连续 \n(空行填充)时 text-run 守卫掐断整轮,但 trip 日志从不命名逃生旋钮,操作者没有可发现的方式调高或禁用它。
  2. 什么原因导致的:诊断面缺失——日志只报观测值(maxTextRun/textRunChar),不报本实例实际执行的阈值,也不提示 guardrails.textRunThreshold/env 这条逃生路径的存在(区间审查(#3331)残留 11 项中小问题集中修:守卫旋钮、存储竞态、静默丢参、CI 触发残角等 #3406 加了旋钮但没接进日志)。
  3. 影响范围与严重程度:仅诊断可发现性——一次被误伤掐断后的排查体验(Gemini/Antigravity 车道);不改任何运行行为。p3。
  4. 怎么修复的:verdict detail 携带本实例生效阈值(创建时解析一次的闭包变量);新增导出 textRunTripHint 仅对 text-run 车道生成操作者提示;两处 trip 日志在 detail JSON 与 "— aborting upstream stream" 之间插入;文档在 docs/clients.md 正确锚点记坑。
  5. 是否有回归问题:无。高危模式逐项过:无语义漂移、无 fail-fast 变吞错、无阈值/时序/输出格式变化(用户可见输出不变,仅错误日志更详细);唯一行为变化是 trip 日志行增量(text-run 车道加 hint;另两条车道的 detail JSON 因共用 detail() 闭包也新增 textRunThreshold 字段——纯诊断增量、无任何解析方,PR 正文 Changes 段已披露该字段新增)。
  6. 是否破坏缓存:不涉及(未触碰缓存/重试/游标/去重任何路径)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:无。只读取既有 guardrails.textRunThreshold(env BILI_GUARDRAIL_TEXT_RUN_THRESHOLD,区间审查(#3331)残留 11 项中小问题集中修:守卫旋钮、存储竞态、静默丢参、CI 触发残角等 #3406 引入);无新字段/改名/改语义。

§7.4 自动合并门:全部满足(单模块 fix、回归测试 5 项在位、rebased head 全绿、无 config/persistence/wire/kernel 变更、纯 fix、diff 干净、Closes #5036、不碰承重基建)。

判定:APPROVE,可合入,等人工合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

本轮 review 已完成,判定:APPROVE,可合入,等人工合并。

做了什么:对 rebase 后新 head b066e451(master 已前进到 f648217c,507 文件大波含 runaway-guard 流守卫重构)做独立复核——重读全量 diff(4 文件 +91/−3,与已审版本逐字同构,唯一冲突 relay.ts 导入行按并集解决)、在新 head 上逐点验证合并后代码(detail() 闭包携带 textRunThreshold、阈值每实例创建时解析一次、feedText 零改动、两处 trip 日志位点 :2341/:2672 均正确插入 hint)、核对 CI 最终态(38 success / 14 gated-skip / 0 failed / 0 pending,单次 API 拉取确认)、确认无 kernel/ 触碰、无新配置面、Closes #5036 在位。

结果:完整 review(含中文八问 + §7.4 自动合并门全满足)见上方同线程评论。无代码级小发现需当场修;唯一披露精度 nit(另两车道 detail JSON 也新增字段)PR 正文 Changes 段已覆盖,低于修复代价,不另提。协调 issue #4599 已报一行。

状态:PR 等人工合并,无未决项。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant