Skip to content

[PR] fix: root-cause batch for preflight compression (persist folds, wall budget, terminal frame, truncate estimate-hold, shared summary pot) - #6926

Open
ranxianglei wants to merge 20 commits into
masterfrom
2026-11-16_rcagg-preflight-compress
Open

ranxianglei wants to merge 20 commits into
masterfrom
2026-11-16_rcagg-preflight-compress

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

⚠️ MODEL-FACING TEXT CHANGE — this PR changes text the model reads (compress tool results, not prompt injections):

  1. The "all candidates failed" external-summary text now branches by failure reason (deadline/timeout → raise the budget; invalid_summary → raise compress.maxSummaryLength; named error → "the attempts below name the failing cause"; otherwise → "see the attempt outcomes") instead of always pointing at maxSummaryLength (cherry-picked from [PR] fix(compress): name non-fetch external-summary failures instead of swallowing them #6890).
  2. The per-attempt timeout detail now reports the ACTUAL window the attempt had (the shrunk target window, or the range's remaining total) instead of the nominal configured value — the number the model carries into its next call matches what the attempt really had ([Bug][compress][externalSummary] Serial 25s/50s default budget makes long-payload chains fail 100%; non-fetch failures a | [Bug][compress][externalSummary] Serial 25s/50s default budget makes long-payload chains fail 100%; non-fetch failures are swallowe… #6885 fix in this PR).

What this PR does

One root-cause PR for the preflight-compress batch (rcagg #6896): preflight compression on large contexts either ran for hours, or failed 100% on long payloads, or latched truncation off meter readings the bill never saw.

Fixes #3978
Fixes #6882
Fixes #6885

The four prior PRs on these issues (#4046, #3590, #5057, #6890) are all direction-aligned with the root cause; their commits are cherry-picked below with -x (authorship preserved) instead of shipping four overlapping PRs.

#3978 — the preflight marathon (three halves)

#6882 — the truncate watermark acts on estimate-grade reads (kernel, option A)

kernel-change: #6882 option A — the emergency-truncate watermark now honors the SAME estimate-hold guard the pressure band already uses: a watermark crossing on an estimate-grade reading (1.75–1.87× overstated after a stream interruption) is held for up to compress.maxEstimateHoldRounds estimate rounds (default 2) instead of latching clips the bill never saw. Already-latched clips still replay byte-for-byte; the held round is unjudged (the terminal streak rides through untouched). Billed readings (incl. the overflow arm), hosts omitting the source marker, and the guard-off / backstop-elapsed cases keep byte-identical behavior. New kernel suite kernel/tests/issue6882-truncate-estimate-hold.test.ts (10 cases); kernel 0.0.198 → 0.0.199. Per the Kernel Boundary this stays in the human-only review tier; it implements the option requested in #6882 via the rcagg pipeline.

#6885 — the external-summary serial budget starves later candidates

  • Shared pot (new in this PR): the batch deadline is now a shared pot — each target gets min(targetTimeoutMs, remaining pot / remaining targets). Before, every target got a fresh targetTimeoutMs window, so t0 (25s) + t1 (25s) ate the 50s total and t2 never got a request out — the chain failed 100% on long payloads (558 target-timeouts / 258 batch-deadlines / 5 successes in the incident log). The configured targetTimeoutMs stays the per-candidate cap; the 600s/180s workaround keeps its full 180s windows (600s/3 > 180s).
  • Name the failures + branch the advice (from [PR] fix(compress): name non-fetch external-summary failures instead of swallowing them #6890, Saim Shafique): non-fetch failures (sync guard, parse failures) now carry a detail and a one-time warn log; the failure text branches by reason (see top).
  • Docs (new in this PR, en + zh): the deadline semantics, the fact that a direct config-file edit is NOT watched (POST /__bili/config/reload or restart applies it; Web-UI saves hot-apply), and the reasoning-target outputTokens pitfall (finish_reason=length + empty body).

Behavior changes (old → new)

  1. Preflight abort ([Bug] Excessive preflight compression time on ultra-large contexts; client mid-disconnect causes repeated request forwar | [Bug] 超大上下文 preflight 压缩耗时过长,客户端中途断开导致请求反复无法转发 #3978): old — a client disconnect mid-marathon lost every fold of that attempt; the retry re-compressed from zero. New — each committed fold is persisted as it lands; the retry resumes from the smaller view.
  2. Preflight wall clock ([Bug] Excessive preflight compression time on ultra-large contexts; client mid-disconnect causes repeated request forwar | [Bug] 超大上下文 preflight 压缩耗时过长,客户端中途断开导致请求反复无法转发 #3978): old — preflight ran until the round cap (16) or budget regardless of wall time (observed 320s+/range, 288s/8 rounds, 864s/32 ranges). New — it stops at a 50s wall budget (elapsed + estimated next round), persisting the folds so far; the retry resumes from the smaller view.
  3. Preflight failure on a committed response ([Bug] Excessive preflight compression time on ultra-large contexts; client mid-disconnect causes repeated request forwar | [Bug] 超大上下文 preflight 压缩耗时过长,客户端中途断开导致请求反复无法转发 #3978): old — a failure after headers were sent could leave the connection hanging. New — the response is terminated with a protocol error frame (SSE event or JSON body).
  4. Emergency truncate on estimate readings (Kernel authorization request: emergency-truncate — does not check the reading level; after a stream interruption, it wil | Kernel authorization request: emergency-truncate 不看读数等级,流中断后按估计值也会截断并锁住;建议沿用 requireUsageSampleForPressure 的守卫和 maxEstimateHoldRoun… #6882): old — a watermark crossing on an estimate-grade reading truncated + latched immediately. New — held under the same estimate-hold guard as the pressure band (default: up to 2 estimate rounds), then acts on the estimate anyway (backstop). Billed readings and guard-off are byte-identical. Old behavior: compress.requireUsageSampleForPressure: false.
  5. External-summary per-target window ([Bug][compress][externalSummary] Serial 25s/50s default budget makes long-payload chains fail 100%; non-fetch failures a | [Bug][compress][externalSummary] Serial 25s/50s default budget makes long-payload chains fail 100%; non-fetch failures are swallowe… #6885): old — each candidate got a fresh targetTimeoutMs window drawn from the shared total (early candidates could eat the whole pot). New — each candidate gets min(targetTimeoutMs, remaining pot / remaining targets); the total deadline still bounds the chain.
  6. External-summary timeout detail ([Bug][compress][externalSummary] Serial 25s/50s default budget makes long-payload chains fail 100%; non-fetch failures a | [Bug][compress][externalSummary] Serial 25s/50s default budget makes long-payload chains fail 100%; non-fetch failures are swallowe… #6885): old — the attempt detail reported the nominal configured budget. New — it reports the actual window the attempt had. (Model-visible, see top.)

Config surface

No new config fields. Two EXISTING fields gain coverage (semantics extend, no migration):

Tests

Local verdict (rebased head)

typecheck clean, build clean, targeted suites green (listed above). Full-suite verdict = remote CI on this head.

awork and others added 16 commits November 16, 2026 17:28
A hard process death mid-preflight (crash / OOM / restart on
multi-million-token sessions) skipped every post-loop persistence
path, so rounds already compressed lived only in memory; a client
retry under a new session id found no parent state worth inheriting
and re-compressed from zero — the permanent unavailability loop
reported in #3978.

commitFold now marks the session dirty as each fold lands; the
persist debounce coalesces the calls into one write per quiet window,
so durable progress accumulates regardless of how the request ends.
A clean client abort already persists via the post-loop rebuild
(src/server.ts:3554 runs before the :3607 fail-fast return); this
closes the death-mid-request gap that path cannot cover.

tests/issue3978-preflight-abort-persistence.test.ts pins it
end-to-end: T1 guards the clean-abort ordering, T2 is the negative
control (no fold committed => nothing fold-like persisted), T3
SIGKILLs a real child proxy mid-marathon and asserts a fresh
instance's new-id retry inherits the persisted blocks instead of
starting fresh. Without the fix the red run fails T3 exactly at the
adopted-block count.

(cherry picked from commit 775d622)
…3978)

The 60s READY deadline lost the race on ubu22-1/win22-1 at head 9be2ec6:
the child cold-transforms the whole src tree via tsx, which exceeds 60s
under parallel-shard load. Raise the deadline to 180s, fail fast when the
child exits before READY (diedP), and capture its stderr in-memory so a
future crash surfaces in the assertion message instead of getting lost in
interleaved shard logs.

(cherry picked from commit dbcc6c8)
…ts resolve (#3978)

On CI the per-test tmp dir sits outside the repo tree, so Node finds no
package.json walking up from the generated child script and defaults it to
CJS. Its bare import of acp-kernel then resolves under the require
condition, which acp-kernel's exports map does not define, killing the
child at boot with ERR_PACKAGE_PATH_NOT_EXPORTED on every leg. Locally the
tmp dir lives inside the repo (inheriting its type:module), which is why
this only failed on CI. Writing a minimal {"type":"module"} package.json
beside the child script pins the module format explicitly. Verified with an
out-of-repo TMPDIR reproduction (red before, green after).

(cherry picked from commit 5722ac7)
… T3 child

The blind sleep(1000) settle raced the store's trailing-debounce write under
loaded CI runners: windows 22-1 at head 5722ac7 found NO parent record at
all when the retry booted (T3 red; signature distinct from #4049's two
#3769 flakes). Replace the fixed sleep with a wait on '[durable] N' — the
child's own codec-aware store.loadSync disk read (envelopes are BILIENC1-
framed at rest, so the test process cannot scan the file for the summary
mark) — so the SIGKILL can never race an unwritten save. Failure messages
now carry the child stderr tail and the store dir listing.

(cherry picked from commit 12de55b)
…78 T3 child

win22-1 @ a46fd0d: [durable] was observed yet the retry still started
fresh (resume lines empty) — findResumeParent (#1486) matches on the
parent's affinity-chain entry, which a fresh instance hydrates from the
machine-shared state-dir snapshot (prefix-affinity.json), a SEPARATE
artifact from the session record with its own 500ms-debounced single-shot
persist whose write can lose a rename race or starve under event-loop
pressure and never re-arms. The child now proves the FILE carries the
t3978-p entry (re-arming the persist while it does not) and the test
waits for that proof before SIGKILL; the final assertion also surfaces
the child stderr tail.

(cherry picked from commit 683d90b)
… EBUSY observation

Minor fix found while fixing this lane's CI (labeled per the small-fix
rule): the #2771 corrupt-index proof spent the full ~9.6s retry ladder
on EBUSY unlinking index.db (transient Windows AV/indexer lock, #2799
family) — extend the flat tail by two 3200ms rungs (~16s total) and
align the budget unit test.

(cherry picked from commit 2b8c26d)
…ence wall clock (#3573)

A summarization round costs 25-44s against a real upstream regardless of
range size (#2682), while the common client timeout class (dsh ~60s) only
fits ONE such round. An over-window preflight kept admitting rounds until
the client disconnected mid-round: the attempt died, the in-flight summary
call was wasted, and the user saw an opaque 60s hang-retry loop (#3573).

Rounds that make upstream calls are now admitted only while the wall clock
leaves room for the next one (estimate: 2x the last round's measured time,
first round always admitted, digest regime exempt — CPU-only by design).
A stopped attempt keeps its completed folds (they are persisted), so the
client's retry resumes from the smaller view and the marathon converges
across attempts; the fail-fast stays a plain 502 with no dead-end cooldown,
and the tier-recovery funnel is suppressed for the stopped attempt so it
cannot sneak extra upstream calls past the budget.

Fixes #3573 (companion to #3586 — same issue, independent half).

(cherry picked from commit 2f00ba6)
…rdict (#3573 review)

When the client-patience wall budget stops the marathon while the payload still overflows the window, the post-loop verdict fell through to the generic branches: 'the compress budget was exhausted after N rounds' (citing a round cap that was never reached), or — in the relaxed-regime subcase — a deterministic exhaustion that server.ts maps to 413, a terminal verdict headless hosts honor by giving up. That kills exactly the retry-convergence story this fix exists for: the folds ARE persisted and the next request resumes from a smaller view.

Give the wall-budget stop its own first-in-cascade verdict: kind exhausted with retryable true and an honest detail (rounds run, folds persisted, retry resumes). No deterministic flag -> stays 502; the dead-end cooldown gate (compressedRanges === 0) is untouched because a wall-budget stop always has at least one landed fold. The issue3573 test now pins the honest wording in every stopped attempt's body.

(cherry picked from commit 7e40615)
…ame (#3978)

Once #568 has committed early headers (200 + SSE/JSON keep-alive), every
no-forward exit left the client holding a 200 and an open stream that never
completes: respond:false writes nothing, and a later status code cannot be
written after the 200 — so clients could not distinguish 'bili gave up' from
a dead network and waited out their own watchdog (#3978 floor 17/18).

All four preflight no-forward exits now emit one terminal frame before
returning when headers are already committed: SSE gets an 'event: error'
frame, non-streaming JSON gets the error object appended after the
whitespace padding (still one valid JSON document), then end(). Body reuses
the native fail-fast shape {ok:false,error:{message,retryable}}. Uncommitted
exits keep their normal status-code path byte-for-byte, and the abort branch
logs its outcome (terminal frame sent / socket gone / not committed).

(cherry picked from commit 4bcbcf9)
Review alignment for the terminal-frame fix: the first commit introduced a
new {ok:false,error:{message,retryable}} frame for committed no-forward
exits, which would have silently replaced the in-band contract master
already emits on this path (protocol-native preflight_compress_failed
frames per #568/#1455 - client SDKs parse those natively; the {ok:false}
shape exists only on /__bili/* admin endpoints).

- commitPreflightTerminalFrame now delegates to emitPreflightError (SSE)
  and appends preflightFailFastBody (non-streaming): byte-identical to
  what the consumer's committed branch already emits, so no wire-shape
  change anywhere.
- preflightFailFastBody extracted into src/stream-error.ts as the single
  source of truth, shared with handle.ts's status-code bodies.
- The genuinely new terminations are unchanged: the abort exit (respond:
  false used to skip all writes) and the overflow-refold re-run
  (respondFailFast=false suppressed the consumer) now terminate with the
  same established frames instead of dangling / hitting
  ERR_HTTP_HEADERS_SENT.
- Tests assert the native shapes; uncommitted negative control unchanged.

Targeted local: issue3978 suite 4/4, adjacent preflight suites 24/24,
tsc clean. Full-suite verdict: CI.

(cherry picked from commit 34020b6)
…allowing them

The executor discarded every candidate rejection, so a context-budget guard or a post-fetch parse failure left only a bare tN:error with no warn line, and the compress failure text blamed maxSummaryLength for every failure. Capture the safe cause for our own fixed error strings (unknown provider errors stay opaque), log it once, and branch the failure advice by the batch's own stop reason: budget on deadline, maxSummaryLength only for over-cap replies.

Fixes #6885

(cherry picked from commit f0867d7)
… readings (#6882)

An ESTIMATE-grade reading (no billing sample landed this cycle — stream
interruption, cache-TTL expiry) structurally overstates what will be
billed (observed 1.75-1.87x), so a truncate-watermark crossing on such a
reading latched clips the bill never saw: content destroyed plus a burned
prefix cache (16.3% hit vs 100% control). The pressure band already uses
the estimate-hold guard (nudge.requireUsageSampleForPressure + the
nudge.maxEstimateHoldRounds backstop); the truncate watermark now honors
the same guard: while the backstop allows, the crossing is held one round
for the usage-grade reading the next request carries. Already-latched
clips still replay byte-for-byte; the round is unjudged, so
terminalStreak rides through untouched. Billed readings (usage, incl. the
overflow arm), legacy callers (source omitted), and
requireUsageSampleForPressure=false keep byte-identical behavior.

kernel-change: #6882 option A — the truncate watermark is the same
phantom-pressure surface as the pressure band, so it reuses the guard the
band already uses rather than a new knob. No new config field; the two
existing nudge fields' semantics now cover the truncate watermark too
(docs updated in kernel/src/types.ts and the host docs in a follow-up
commit).
…dates (#6885)

The per-target window was a fresh targetTimeoutMs for every candidate, so
early candidates ate the whole pot: with the 25s/50s defaults, t0 ran 25s,
t1 was killed at the 50s batch deadline, and t2 never got a request out —
the chain failed 100% on long payloads no matter how fast the later
candidates were (558 target-timeouts / 258 batch-deadlines / 5 successes in
the incident log). The batch deadline is now a shared pot: each candidate
gets min(targetTimeoutMs, remaining-pot / remaining-candidates), so a slow
early candidate times out at its fair share and the next candidate gets the
remaining budget (fast failures return their share to the pot). The
configured targetTimeoutMs stays the per-candidate cap; the 600s/180s
workaround keeps its full 180s windows (600s/3 > 180s).

The timeout detail now reports the ACTUAL window the attempt had (the
shrunk target window, or the range's real remaining total) instead of the
nominal configured value — the attempts list is model-visible in the
compress tool result, so the number the model reads now matches what the
attempt actually had.

Fixes #6885 (issue 1: default budget + serial attempts fail long-payload
chains 100%).
…d config reload (#6882, #6885)

- compress.requireUsageSampleForPressure / maxEstimateHoldRounds now cover
  the emergency-truncate watermark as well as the pressure band (#6882):
  table rows, the detail section (the stale 'truncate stays armed
  regardless' line is replaced), and the host config.ts doc comments.
- external-summary deadline semantics: the batch deadline is a shared pot —
  each target gets min(targetTimeoutMs, remaining pot / remaining targets)
  (#6885); the stale 'each target gets a fresh window' sentence and the
  sizing advice are updated accordingly.
- external-summary: a direct config-file edit is not watched — it applies
  on POST /__bili/config/reload or restart (Web-UI saves hot-apply);
  reasoning targets need a large outputTokens or they end in
  finish_reason=length with an empty body (#6885).
- en + zh kept in parity.
@ranxianglei ranxianglei added bug Something isn't working p1 root-cause labels Nov 16, 2026
@ranxianglei ranxianglei changed the title fix: root-cause batch for preflight compression (persist folds, wall budget, terminal frame, truncate estimate-hold, shared summary pot) [PR] fix: root-cause batch for preflight compression (persist folds, wall budget, terminal frame, truncate estimate-hold, shared summary pot) Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-16_rcagg-preflight-compress (362878d)

Latest build — install this exact version

npm install -g billion-context@0.0.11009-pr.6926.5852c92

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
362878d billion-context@0.0.11009-pr.6926.5852c92 build
3319d46 billion-context@0.0.10412-pr.6926.87a151e build
963ed72 billion-context@0.0.10370-pr.6926.6f7b16e build

Download artifact

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

Install instructions are refreshed on each push.

ci-check added 3 commits November 16, 2026 20:28
…le text

The PR body's docs commit edited the GENERATED table rows in
docs/configuration.md / .zh-CN.md directly, without updating the
website/config-reference/compress.yaml seed they are generated from
(#2107 drift guard A). docs-sync went red and, via the test job's
!failure() needs gate, skipped the whole test matrix.

This commit moves the PR's exact table text (en+zh) into the seed's
desc_en/desc_zh for compress.requireUsageSampleForPressure and
compress.maxEstimateHoldRounds; regenerating now reproduces the
committed docs byte-for-byte (verified: gen-config-docs generate +
git diff --exit-code clean). desc_ja and the site_* website fields are
untouched, matching the PR's en+zh-only docs scope.
The kernel-change commit bumped kernel/package.json 0.0.198 -> 0.0.199
but left both lockfiles at 0.0.198, so the #3782 lock-sync drift guard
went red (and, like docs-sync, skipped the test matrix via the
!failure() needs gate). Regenerated with npm install --package-lock-only
(root + kernel); the diff is exactly the version line in each file.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

PR #6926 审核结论(preflight 根因批)

独立审完:逐段读了全 diff(22 文件 +1555/−106)、核对了三个源 issue 的方向、在本地跑过定向测试、live 查了 CI 并修掉了两条 PR 自身漂移(见下)。

① 方向关(原 issue):三个 issue 的根因判定都成立,PR 修的是生产者不是症状——

② 回归关(既有行为清点):逐路径过过——

③ 代码关:无 as any/@ts-ignore;命名达意(wallBudgetHit、effectiveTargetMs、summaryErrorDetail、externalSummaryFailureAdvice、commitPreflightTerminalFrame);无死代码;50s 是具名常量 + 测试缝;注释讲为什么且带来源。模型可见文本改动(PR 顶部已按规警示):timeout 明细现在报实际窗口(收缩后的 target 窗口 / 该 range 的真实剩余 total)——模型下一轮携带的数字与尝试真实拥有的窗口一致,无 phantom 值;advice 按失败原因分支指对旋钮,不再一律甩 maxSummaryLength。

④ 测试关:全是真测试——kernel 10 例逐字节/ latch / streak / 兜底/ guard-off / cap-0 / legacy 各有断言;共享池测试把旧断言反向钉住(backup 候选从"饿死"变"成功");issue3573 真 server e2e(慢轮:wall stop→502→无 cooldown 污染→fold 持久→重试收敛 200;快轮:单 attempt 完成、零 stop 行);terminal-frame e2e 用 deadline race 把修复前的静默悬挂变红;abort-persistence e2e 的 T3 是真 SIGKILL 子进程中途死亡,新 id 重试经 affinity 链继承持久 fold——这是唯一能覆盖「进程硬死跳过 post-loop 重建」的形状。

CI 状态(live 核实 + 已修):原 head 963ed72 上 docs-sync + lock-sync 红(PR 自身漂移:直接改生成物未更种子;kernel bump 漏 lockfile),test 矩阵被 !failure() needs 门禁连带跳过。已在分支修掉:bec220416e(种子同步,en+zh 表格文本移入 compress.yaml desc_*,再生成逐字节复现 PR 的文档)+ 25ead4195d(两个 lockfile 同步 0.0.199),并 merge 当前 master(新 head 3319d46)。本地:三门禁 PASS、typecheck 干净、kernel issue6882 10/10、external-summary+http 96/96、verif-subset-guard 2/2。全量判定 = 新 head 的远程 CI。

八问

  1. 是什么问题:超大上下文的 preflight 压缩要么跑几小时(客户端断开后重试从零重压、永久不可用循环),要么长载荷下 100% 失败(串行预算被早期候选吃光),要么对着账单从未见过的估算读数 latch 截断(毁内容 + 烧前缀缓存)。
  2. 什么原因导致的:① marathon 无墙钟准入且进度只在循环后落盘,abort/进程死亡即丢全部进度;② 每个摘要候选拿全新 targetTimeoutMs 窗口、共享 total 无公平分配,25s/50s 默认下三候选长载荷链必然饿死;③ 紧急截断水位不查读数等级——压力带有的 estimate-hold 守卫(truncate 侧缺失),估算读数在流中断后结构性虚高 1.75–1.87×。
  3. 影响范围与严重程度:p1 级。over-window 上下文用户完全不可用(重试循环);长载荷外部摘要链 100% 失败(大折叠场景功能不可用);estimate 级截断在流中断/短 TTL 场景触发,破坏账单未见的真实内容并烧前缀缓存(实测 16.3% vs 100% 对照)。
  4. 怎么修复的:① 每个已提交 fold 立即 markDirty 落盘 + 墙钟准入(elapsed + 2×上轮实测 > 50s 即停,已完成 fold 持久化、重试从小视图继续)+ 已提交响应的 no-forward 出口发协议终帧;② 共享池:每候选 min(targetTimeoutMs, 剩余池 ÷ 剩余候选),总 deadline 仍封顶;③ truncate 水位复用同一 estimate-hold 守卫(requireUsageSampleForPressure + maxEstimateHoldRounds,默认 2),已 latch 的 clip 仍逐字节回放,hold 轮未裁决。
  5. 是否有回归问题:无。below-threshold / latch 回放 / usage 级 / legacy / guard-off 路径逐字节不变(测试钉死);未提交出口走原状态码路径(负控);wall stop 走 502 不走 413(保重试收敛);no-leak 规则保住。有意行为变更(已披露):共享池下慢早期候选在自己的公平份额处超时、后续候选拿剩余(旧:各拿全新窗口);estimate 级 truncate 交叉现在 hold 至多 2 轮(新,即本修复);marathon 在 50s 墙钟处停(新,即本修复)。
  6. 是否破坏缓存:不破坏——烧前缀缓存正是 bug 之一(estimate 级截断),修复减少缓存燃烧;无缓存/重试/增量游标/去重键策略变更。
  7. 是否改了设计方向:没有——修复全部落在既有 preflight / external-summary / kernel-truncate 架构内,无新车道、无新数据流。
  8. 是否引入了新的配置:无新键——compress.requireUsageSampleForPressure 与 compress.maxEstimateHoldRounds 现在同时覆盖压力带与 truncate 水位(同键、同默认、同 per-field 合并语义);无新 env。

收工判定:代码与测试层面 ready;kernel 变更留人审档(§7.4 不可 auto-merge)。等 head 3319d46 的 CI 转绿后由 owner 合并;合并后四个被取代的在途 PR(#4046 / #3590 / #5057 / #6890)请 owner 关闭(按政策我不代关)。

Resolve kernel version collision: PR 0.0.199 vs master 0.0.200 -> 0.0.201
(kernel/package.json + kernel/package-lock.json + root package-lock.json).
Precedent 889493b: master's version + this PR's own kernel step
(#6882 truncate estimate-hold). All 9 both-sides host files auto-merged;
each verified byte-identical to an independent git merge-file 3-way.
Lockfiles stable under npm install; typecheck + build + targeted tests green.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

PR #6926 merge conflict resolved and pushed.

What was done this run:

  1. Live state verified at wake: PR head 3319d46, base master 6453feeeb84, mergeable_state: dirty (merge conflict); the PR branch was 147 commits behind master.
  2. Merged origin/master into 2026-11-16_rcagg-preflight-compress — this branch's established pattern is merge (its own head 3319d46 was already a master-merge commit), so merge, not rebase.
  3. Exactly 3 conflicts, all the kernel version field: kernel/package.json, kernel/package-lock.json (top-level + packages.""), root package-lock.json (the kernel entry). PR carried 0.0.199; master carried 0.0.200 (master's own kernel release step).
  4. Resolved at 0.0.201 — repo precedent 889493b: master's version + this PR's own kernel step (Kernel authorization request: emergency-truncate — does not check the reading level; after a stream interruption, it wil | Kernel authorization request: emergency-truncate 不看读数等级,流中断后按估计值也会截断并锁住;建议沿用 requireUsageSampleForPressure 的守卫和 maxEstimateHoldRoun… #6882 truncate estimate-hold: kernel/src/compress.ts, kernel/src/types.ts, new kernel/tests/issue6882-truncate-estimate-hold.test.ts — none on master). kernel-guard requires the version line to differ from master whenever kernel/src differs, and forbids bump-without-src-change — 0.0.201 satisfies both.
  5. All 9 both-sides host files auto-merged (src/config.ts, src/preflight.ts, src/server.ts, src/server/handle.ts, scripts/live-files.mjs, website/config-reference/compress.yaml, docs/configuration.md/.zh-CN.md/.ja.md); each verified byte-identical to an independent git merge-file 3-way computation (base 4a24c26, ours = PR head, theirs = master).
  6. Local verification (targeted, per §7.2): gen-config-docs generate → no artifact drift; check-coverage OK (204 env + 63 keys); check-architecture-docs all green (325 src files); full npm install (root 614 / kernel 56 / pi-subagents 190) left both lockfiles byte-stable; npm run typecheck PASS; npm run build PASS; targeted tests 152/152 green: kernel issue6882 10/10 · kernel master-side issue4292/5109/5432/7270 37/37 · host issue3573 + issue3978-terminal-frame + external-summary + external-summary-http 102/102 · issue3978-abort-persistence (child-proxy) 3/3.
  7. Pushed merge commit 362878d as the final head (no [ework:ci-held] marker — this is the branch's one full CI pass). Pre-push: git fetch origin confirmed remote head still 3319d46 (fast-forward, no concurrent pushers).
  8. Live re-check after push: mergeable: true, mergeable_state: blocked (was dirty) — the conflict blocker is cleared; the remaining block is the normal CI/review gate. Full CI now runs on head 362878d.

八问(结构化结论):

  1. 是什么问题: PR 分支落后 master 147 个提交,合并状态 dirty(合并冲突),PR 无法进入评审/合并。
  2. 什么原因导致的: 分支开发期间 master 前进了 147 个提交,双方都改了 kernel 版本字段(master 自己发布了 kernel 0.0.200,PR 侧是 0.0.199 + 本 PR 自己的 kernel 步骤)→ 版本行文本冲突。
  3. 影响范围与严重程度: 仅影响本 PR 的可合并性,无用户面影响。严重度:PR 被阻塞(特定条件:冲突解决前无法合并)。
  4. 怎么修复的: 按分支既有模式 merge origin/master 进 PR 分支;版本冲突取 0.0.201 = master 的 0.0.200 + 本 PR 自己的 kernel 步骤(先例 889493b),同时满足 kernel-guard 的「kernel/src 有变更时版本行必须与 master 不同」与「无 src 变更不得 bump」两条。
  5. 是否有回归问题: 无。9 个双方都改的文件逐字节比对独立 3-way merge 结果一致;typecheck/build/152 个定向测试全绿;lockfile 在完整 install 下零漂移;合并本身是两侧变更的纯并集,无语义改动。
  6. 是否破坏缓存: 不涉及(未触碰缓存/重试/增量游标/去重键逻辑)。
  7. 是否改了设计方向: 不涉及(纯冲突解决,无架构/边界/数据流变更)。
  8. 是否引入了新的配置: 不涉及(无新 env/config/默认值;kernel 0.0.201 是版本号,不是配置项)。

判定: 冲突已解决并以最终头 362878d 推送,mergeable_state dirty → blocked(剩余 block = 正常 CI/评审门禁)。全量 CI 在该头上运行,后续看 checks 结果。

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