From 4e3c0bf7284e8cab669fbeb7610350d72001e517 Mon Sep 17 00:00:00 2001 From: ework-agent Date: Sat, 24 Oct 2026 21:16:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20repair=20the=20#4525-train=20merge=20cas?= =?UTF-8?q?ualties=20=E2=80=94=20sidScope=20rename=20straggler,=20judge=20?= =?UTF-8?q?render-lane=20union,=20codex=20state-mode=20ledger=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LIFECYCLE.md | 1 + src/agent/dsh-native.ts | 4 ++-- src/server/relay.ts | 19 +++++++++++-------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/LIFECYCLE.md b/LIFECYCLE.md index 21d54c4418..6e26fc9774 100644 --- a/LIFECYCLE.md +++ b/LIFECYCLE.md @@ -28,6 +28,7 @@ | `BILI_FOLD_RECONCILE` | #1921 | fold 对账模式 off/warn/repair(默认 repair;非法值只告警不致命,src/fold-reconcile.ts:384) | 增量车道 #3248 落地后评估 legacy 对账路径去留 | 在用(默认 repair);与 #3248 联动 | | `BILI_RECLAIM_FETCH_PATCH` | #1158 | escape hatch:`=0` 保留经典直装 fetch patch 路径 | fetch-chain patch 成为既定行为后退役 | 默认开(`=0` 回退经典路径) | | `BILI_CODEX_COMPACT` | #3008 | codex compaction 拦截 kill-switch(intercept/pass);intercept 覆盖显式与内联 auto-compact(SUMMARIZATION_PROMPT 识别) | intercept-by-default 站稳后评估 pass 模式是否还有人需要 | 默认 intercept | +| `BILI_CODEX_STATE_MODE` | #2222 | codex state-db 策略逃生门:auto(默认,二进制支持 CODEX_SQLITE_HOME 时 shared 否则 legacy)/ legacy / shared(不支持时降级 legacy 并告警,src/launcher.ts:3666) | shared 为既定行为后评估逃生门去留 | 默认 auto | | `BILI_SQLITE_AUTO_DOWNLOAD` | #2833 | sqlite 引擎自下载开关(严格 1/0 > 文件 > 默认 true;被拒时仍用缓存副本) | —(转正为常设安全阀则移 §2) | 在用(默认 true) | | `BILI_NATIVE_ATTACH_EXTERNAL` | #1322/#1335 | 外部 attach opt-in:默认拒绝 attach 到会长命于会话的实例(拒绝文案见 launcher.ts:3561) | —(长期安全姿态则移 §2) | opt-in(默认 false) | | `BILI_LAUNCHER_DIRECT` | launcher direct-URL 模式 | `=1` 进入直通 URL 模式:LLM 流量不过代理 ⇒ 无压缩(只有 bili MCP 调用可用);默认 MITM | —(两种模式都是正式入口则移 §2) | opt-in(`=1`) | diff --git a/src/agent/dsh-native.ts b/src/agent/dsh-native.ts index 59c9b253e0..f3c63cc06c 100644 --- a/src/agent/dsh-native.ts +++ b/src/agent/dsh-native.ts @@ -1284,8 +1284,8 @@ function noteForkVerdict(verdict: Extract): voi // exactly what #4215 needs named in the log (C10b). if (noticedForkBlindSpot) return; noticedForkBlindSpot = true; - const scoped = sidScope.getStore(); - const scopedActive = typeof scoped === "string" && scoped.length > 0; + const scoped = dispatchScope.getStore(); + const scopedActive = scoped !== undefined && scoped.sid.length > 0; const shape = verdict.reason === "initiator-threw" ? `threw (${verdict.detail ?? "unknown"})` : verdict.reason === "initiator-missing" ? "returned no agent" diff --git a/src/server/relay.ts b/src/server/relay.ts index 1133d73a10..b1433a0753 100644 --- a/src/server/relay.ts +++ b/src/server/relay.ts @@ -724,13 +724,17 @@ export async function forward( // steering / chain-stamp / shed rewrites, so I1/I2 see the wire truth. // Advisory; never blocks. Replaces the pre-send hook (handle.ts) which // judged a pre-rewrite snapshot. - // #4241: on a snapshot-render turn the outbound prefix is server-rendered - // (transcript rows + summary carriers), not the raw inbound bytes — the - // judge must exempt that region and validate only the client tail. The - // boundary was recorded by prepare's maybeSnapshotView on the same session. - const renderTailStart = typeof prepared.session.metadata["snapshotRenderTailStart"] === "number" - ? (prepared.session.metadata["snapshotRenderTailStart"] as number) - : undefined; + // #4241 (union of #4531 + #4525's train): on a snapshot-render turn + // the judge's baseline IS the rendered view (judgeBaseline), so legacy + // I1/I2 stay fully armed against it — a dropped/rewritten rendered row + // still fires (teeth, tests/issue4241-judge-render-baseline.test.ts). + // The renderTailStart exemption was the older #4525-train design for + // the same false-positive (raw-inbound baseline); with the rendered + // baseline present it is redundant AND blinds I2 to rendered-prefix + // defects, so it must NOT be passed here. The judge keeps the + // renderTailStart API as the raw-inbound escape hatch (unit-pinned in + // tests/invariant-judge.test.ts), and maybeSnapshotView still records + // snapshotRenderTailStart for diagnostics. maybeRunInvariantJudge({ // #4241: a render-lane turn's outbound is built from the SERVER // transcript (summary anchors + store rows), so its ground truth @@ -743,7 +747,6 @@ export async function forward( body: sentBody, protocol: prepared.protocol, sessionId: prepared.session.id, - ...(renderTailStart !== undefined ? { renderTailStart } : {}), }); } // #3148: round-level breaker — while the endpoint is provably dead, fail