Repository navigation
[PR] Review P2 fixes: dedupe the double body scan, pin expiring media refs, snapshot pre-OOM envelopes before overwrite, trace msgid-rescue - #5895
Merged
Conversation
added 2 commits
November 7, 2026 23:06
…hot, msgid-rescue trace
- throttle F1: requestModelFromBody memoizes {body→model} on a request-scoped
cacheHost so the pre-ingest early-hold gate and the full 429 gate share ONE
body scan instead of walking the multi-MiB document twice per POST
- media-refs F2 (kernel): pre-signed/expiring HTTP(S) URLs (X-Amz-*/X-Goog-*/
X-MS-*/SAS/Expires/Signature/…) are classified NON-recoverable — the handle
lapses before a folded summary is decompressed, so the message keeps pinning
- persist: an envelope that OOM'd on decode is snapshotted before the next
save overwrites it (preoomPending set + withPreoomSnapshot)
- session-resolve: every msgid-rescue firing now logs hits/exit-context as
#5719 overlap-rung reachability evidence
- kernel 0.0.185 → 0.0.186 (media-refs change), lockfile synced
Review findings from #5865 master-diff review (P2 batch).
…THING, not the bare prefix The alternation's $ anchor made 'X-Amz-Algorithm' (and every other x-<provider>-* signed param) fall through as durable. Keep $ only on the exact-key branch.
Contributor
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.8542-pr.5895.ce93a3bThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5895.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1076-master.cda6e73 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Louie0806
added a commit
to Louie0806/billion-context
that referenced
this pull request
Nov 7, 2026
…ch; relay hunk disjoint from the lane's egress Adopts the three-commit ranxianglei#5895 batch: model-scan memo, ephemeral-ref pinning, preoom snapshot and msgid-rescue trace, plus the kernel-side `EPHEMERAL_QUERY_PARAM` prefix fix (`178fc0318`). Kernel is now `acp-kernel@0.0.186`. The only shared file is `src/server/relay.ts`. Master's edit is a single one-line hunk at `912` (`forwardCaptured` bookkeeping); the lane's egress guard sits at `2062`. Hunk ranges are disjoint, so git auto-merged without a conflict and both sides verify present afterwards: - `src/server/relay.ts:2062` — `await pipePluginJson(toClient, res, undefined, prepared.protocol, undefined, undefined, undefined, reply);` - `src/storage/mysql.ts:77` — `export const MYSQL_SCHEMA_VERSION = 11;` Verified on the merged tree (CI preload chain, `BILI_STORAGE_UNIFIED=legacy`, kernel rebuilt): tests/issue5175-drift-name-leak.test.ts 58/0, tests/tag-echo.test.ts 79/0, tests/issue2190-degen-close.test.ts 32/0, tests/golden-storage-render.test.ts 5/0, tests/storage-engine-proofs.test.ts 12/0, tests/wire-contract.test.ts 23/0, tests/issue4666-migration-dedup.test.ts 2/0, tests/native-compact-terminal.test.ts 1/0, tests/issue5865-model-scan-memo.test.ts 4/0, kernel/tests/issue5620-ref-recoverable-media.test.ts 11/0. `tsc --noEmit` clean; the four repo gates exit 0; `gen-config-docs generate` is a no-op on the four generated artifacts.
This was referenced Nov 7, 2026
This was referenced Nov 7, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这是什么问题
#5865 大 diff review 定级的 4 个中等问题(P2:不立刻坏,但都是实打实的浪费或隐患):
model字段——每 MB 约 1ms,纯重复劳动,每个代理 POST 都付一次。怎么修的
requestModelFromBody增加请求级 memo(WeakMap 挂在 IncomingMessage 上,body 按 identity 锁定):两个闸门共享同一次扫描;body 变了自动重扫。新增测试计数器 pin「一次扫描、两处消费」+ 4 个单测。media-refs:X-Amz-*/X-Goog-*/X-MS-*/SAS/Expires/Signature/token等签名/过期特征的 HTTP(S) URL 一律视为不可恢复 → 消息继续 pin。宁可误 pin 一条消息,不可丢载荷。11 个新用例(S3 v4/v1、GCS、Azure SAS、CDN token、以及 durable URL 不误伤)。persist:OOM 文件(id 记入preoomPending)在下次覆盖保存前先 rename 成.corrupt-preoom-<ts>快照(沿用.corrupt-家族的 cap-1 清理);保存失败把快照改回去,绝不把健康字节困在取证名后面。session-resolve:msgid-rescue 每次触发打一行 warn(hits/exit 上下文/首命中 id)。kernel-change: media-refs classifies pre-signed/expiring HTTP(S) URLs (X-Amz-/X-Goog-/SAS/Expires/Signature/token) as NON-recoverable — messages keep pinning instead of folding out bytes whose only handle lapses; kernel 0.0.185 → 0.0.186, lockfile synced
评审里另一条「loadConfigFile 每次调用 readFileSync」不改:#2078 已把「内容为准、mtime/size 不可信」钉成测试(防 web-UI Apply 在粗时间戳文件系统上读到旧值),stat 门会破坏这个安全语义,换来的只是每请求几十微秒——收益配不上风险。
armInternal的两次 resolve 也是刻意的(第一次挡掉多 MB body 的 JSON.parse)。验证
npm run build+tsc --noEmit✅