Skip to content
Open
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ Versions follow the merge of a `*_release-v*` branch; CI publishes to npm on tag
- **测试钉住契约**:tests/storage-bun-sqlite.test.ts —— 假 Database 那几组经测试缝 `setBunDatabaseFactoryForTests` 在 Node CI 上同样可跑(记号双写、字面量外只重写一次、BigInt/Uint8Array/null 归一、事务必须 `.immediate()`、阶梯第 0 步优先、被钉的 `{builtin, host}` 探针袋视为 Node 主机);真内置那几组仅在 bun 下跑(真 BEGIN 与回滚、嵌套事务不提前提交、写完锁立刻交还,以及真 UnifiedStore 端到端:开库跑 PRAGMA 阶梯 + quick_check + 迁移、命名参数插入、读回、close 触发 WAL checkpoint 后重开仍在)。
- **既有存储套件在 bun 下实测**:7 处写死 `openSqliteDatabase(path, "node:sqlite")` 的裸句柄改为随动自动探测后,block-bounds 1/0、fork-clone-media 3/0、issue4982 18/0、unified-remap 3/0 全绿;storage-unified 从 4 通过/13 失败变成 14 通过/4 跳过/0 失败(三条只驱动 `node:sqlite` 的 leg 现按驱动探针跳过);storage-ingest-watermark 15/1、bounded-load 4/1、engine-proofs 7/5、plugin-fork 51/5、engine-bootstrap 维持 43/1。与改动前同机基线相比:多通过 24 条,零回归。剩余失败与存储引擎无关:bun 的 node:test 垫片没有 `t.mock`(oven-sh/bun#5090)、Node 专用套件顶层静态 `import("node:sqlite")`、以及子进程 harness 在 bun 下的 ERR_SERVER_NOT_RUNNING。

### #3248 — 增量车道 GA:全新安装开箱即用

- **行为变更(旧→关→开)**:增量车道(宿主只发对话增量、不再每轮全量重发历史,#3248/#5155/#5156)此前 `rollout.features.pluginIncrementalTurns` 打包值为 `percent: 0`——**每个安装都要运营者手动开**。四个当年阻塞它的缺陷已全部关闭并修复:#3343(marker divert 缺回环校验,安全)、#3433(dsh-native 未接入 `wireMessagesLookAnthropic`,OpenAI 车道会丢 `tool_calls`)、#3352(opencode 原生零收益)、#3369(一次瞬时失败永久降级)。现在打包值改为 **`percent: 100`**:新装用户无需任何配置文件、环境变量或面板操作,装上即走增量车道。
- **为什么默认翻转是安全的**:快车道只在**全部**验证命中时接手——请求体形状(`incrementalTurnBodyShape`)、宿主 GET 探针、统一存储 sidecar、回执。任何一项不满足就整轮回落到原有的全量重发路径,字节与从前完全一致。所以这个默认值只改变**宿主发出多少字节**(#5156 的收益),不改变任何正确性保证。安全面同理:形状化请求在进入 `applyTurn` 之前先过 `adminGateDenial` 回环校验(#3343),非回环/隧道/不可信来源一律 403,默认开启不扩大攻击面。
- **单一开关 + 两个逃生口**:文件 `rollout.features.pluginIncrementalTurns: false`(或任意 percent 灰度)、环境变量 `BILI_ROLLOUT_PLUGIN_INCREMENTAL_TURNS=0`。两者语义与顺序不变:env > config > 打包 percent > 关闭(fail closed)。
- **升级提示**:已在跑增量车道的安装字节不变(它们本来就开着);从默认关升上来的安装,第一个回合起即走增量路径,无需重启以外的任何操作。需要保回旧行为的用户设上面任一逃生口即可。
- 测试:`tests/incremental-lane.test.ts` 的探针用例按新契约翻转(默认报 enabled,env `0` 才关);503 用例改由 env 逃生口驱动;新增 `tests/rollout.test.ts` 内的 GA 打包值 + 双逃生口断言,以及 `tests/incremental-lane-default-on.test.ts`(干净 XDG 根、无配置文件、真实 `featureEnabled`/`incrementalTurnsEnabled`/`GET /__bili/plugin/turn` 三段驱动;反向对照证明默认回退到 0 时 1/2/5 三条必须变红)。

### #5079 — `prompt_cache_key` 自注入默认关闭,`promptCache.routing` 一个开关管住两条 wire

- **行为变更(旧→新)**:此前 bili 在插件车道对一切目的地默认给请求体盖 `prompt_cache_key=<会话 id>`(#2218/#2649 定案,Responses wire 仅对 `api.openai.com` 注入)。由于大量服务见到该字段会直接拒绝、且这类服务无法枚举,**默认反转为关闭**:`promptCache.routing` 缺省值从 `"auto"` 变为 `"disabled"`(无法识别的值同样落到 `"disabled"`)。客户端自带的 key 不受影响:任何模式下都原样转发(A/B 探测记忆对已证实拒收的 origin+model 组合照常撤键)。
Expand Down
2 changes: 2 additions & 0 deletions docs/configuration.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
| `rollout.features.identityChannelHarvest` | boolean \| number | 0 (off) | BILI_ROLLOUT_IDENTITY_CHANNEL_HARVEST | IDチャネル収穫コホートゲート (#5825):インストールごとの環境スイッチなしで、ループバック専用のトランスクリプト/sqlite収穫(`src/identity-harvest.ts`: claude-code / codebuddy / mcode / goose / qwen レーン)を許可する。インストールごとのスイッチ(`BILI_IDENTITY_HARVEST`)もこのキーも設定されていない場合、クライアントストレージは一切読み取られない。オーナー裁定 2026-11-07:このコホートキーは `rollout.features.pluginLaneServerHistory`(承認済みIDの行固定を管理)とは意図的に分離されている — いずれかのイネーブラーが収穫を有効化できる。デフォルト 0%;小規模コホートでの degrade warn-once レートの観察後に引き上げる。`identity-channels.md` を参照。 |
| `rollout.features.pluginLaneServerHistory` | boolean \| number | 0 (off) | BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY | プラグインレーンのサーバー所有履歴 (#4491):有効化されたインストールにおいて、(a) プラグインレーンのリクエストは `messages` と並行して内部 `biliMsgIds` 配列を持ち、メッセージIDをクライアント提供のIDに固定できる(上流転送前に常に除去;不正な配列は警告付きで無視、ID汚染形状は増分レーンでハードフェイル);(b) ループバック専用の `POST /__bili/plugin/render` エンドポイントは、統合トランスクリプトからレンダリングされた送信プレフィックスを提供する(折り畳み領域はサマリアンカーに縮小;デシンクは非2xxにデグレードし、シムはローカル履歴にフォールバック);(c) 増分レーンのプローブは `serverHistory` をアドバタイズする。デフォルト 0% — ロールアウトされるまで挙動は変わらない。 |
| `rollout.features.pluginFullResendWatermark` | boolean \| number | 5 (experimental grey) | BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK | フルリセンドウォーターマークファストパス (#5403/#5418):前回のレスポンスに `x-bili-pf-seq` ス tamp を持っていたプラグインレーンのチャットコンプリートターンでは、エコーされたカウントにより再送信プレフィックスをアサートする(構造スキャン、フルパースなし);ヒット時にパイプラインはスタッシュされた正規プレフィックスコアと新しいテールウィンドウのみを消費する(バイト同一の送信プロベナンス;疑義がある場合はターンごとに未変更のフルパースパスにフォールバックし再スタンプ、5回のクレジットミスでレーンを1時間保持)。クライアントがスタンプを `x-bili-pf-count` としてエコーバックすることを要求(dsh/pi/opencode/omp は対応;未適応レーンはヒットしない)。実験的グレースケールロールアウト — インストールの約5%でデフォルトON(オーナー裁定 2026-11-02:GA前に小規模コホート;Web UIで全インストールに一度限りの導入通知、クイック設定に3状態スイッチ)。`true` で強制、`false`(またはパーセンテージ)/ 環境変数 = 0 でオフ。`technical-notes.md` の「Full-resend watermark fastpath」を参照。 |
| `rollout.features.pluginIncrementalTurns` | boolean \| number | 100 (on) | BILI_ROLLOUT_PLUGIN_INCREMENTAL_TURNS | インクリメンタルターンレーン (#3248):有効化されたインストールでは、ネイティブプラグインホストが各ターンで会話の差分のみ(ホスト msgid エンベロープ付き)を送信し、履歴全体を再送信しない。bili は統合トランスクリプトから送信リクエストを再構築し、通常のフォールド/レンダリングパイプラインを処理する。このバージョンから GA——新規インストールはデフォルトで差分方式。統合ストレージ sidecar を持たないインストールは自動的にフルリセンドのまま(プローブが storage=legacy-only を報告)。false / パーセンテージ上書き、または BILI_ROLLOUT_PLUGIN_INCREMENTAL_TURNS=0 でオフにできる。 |
| `maskHosts` | boolean | true | BILI_LOG_MASK_HOSTS | ログ内の非公開ターゲットホストを <private-host> としてマスクする。認証情報ヘッダーは常にマスクされる。 |
| `security.adminRelay` | boolean | false | — | エンベディングホスト(現在は dsh web)が、リモートブラウザからパネルを開けるように(#3373)、その自身のエントリーオリジンを通じて /__bili/ 管理サーフェス全体をリレーすることを許可する。フェイルクローズ、ファイルのみ。リレーされたホップはローカル非ブラウザクライアントとしてプロキシに到達する(ループバックソース + ループバック Host、Origin なし)ため、管理ゲートは変更されない。これを有効にすると、ホスト Web エントリーに到達できる者に設定編集と認証情報の書き込みが露出する — まずそのエントリー(認証 / リバースプロキシ)を保護すること。 |
| `subagentSplit` | boolean | true | BILI_SUBAGENT_SPLIT | Claude Code サブエージェントは、メインセッションのキューに並ぶ代わりに、独自のセッション名前空間(<session>\|sub:<agent-id>)を取得します。Anthropic-wire 専用 — Responses wire ではこのスイッチは no-op です(`subagentSplit` / BOTH-mechanisms スコープ注記を参照)。 |
Expand Down Expand Up @@ -2023,6 +2024,7 @@ ACP ネイティブエージェント(現在は `pi` 拡張機能)は、プ
| `BILI_ROLLOUT_<FEATURE>` | `rollout.features.enabled` | unset (bucket math decides) |
| `BILI_ROLLOUT_IDENTITY_CHANNEL_HARVEST` | `rollout.features.identityChannelHarvest` | 0 (off) |
| `BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK` | `rollout.features.pluginFullResendWatermark` | 5 (experimental grey) |
| `BILI_ROLLOUT_PLUGIN_INCREMENTAL_TURNS` | `rollout.features.pluginIncrementalTurns` | 100 (on) |
| `BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY` | `rollout.features.pluginLaneServerHistory` | 0 (off) |
| `BILI_SESSION_CONTENT_STORE_PIN` | `sessions.contentStorePin` | false |
| `BILI_SESSION_GC` | `sessions.gc.enabled` | false |
Expand Down
2 changes: 2 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ This index is generated from `website/config-reference/*.yaml` — edit the seed
| `rollout.features.identityChannelHarvest` | boolean \| number | 0 (off) | BILI_ROLLOUT_IDENTITY_CHANNEL_HARVEST | Identity-channel harvest cohort gate (#5825): allows the loopback-only transcript/sqlite harvest (src/identity-harvest.ts: claude-code / codebuddy / mcode / goose / qwen lanes) without any per-install env switch, when neither the per-install switch (BILI_IDENTITY_HARVEST) nor this key is set nothing ever reads client storage. Owner ruling 2026-11-07: this cohort key is deliberately separate from rollout.features.pluginLaneServerHistory (which governs row PINNING of admitted ids) — either enabler may activate harvesting. Default 0%; raise after small-cohort observation of the degrade warn-once rate. See identity-channels.md. |
| `rollout.features.pluginLaneServerHistory` | boolean \| number | 0 (off) | BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY | Plugin-lane server-owned history (#4491): for enabled installs, (a) plugin-lane requests may carry an internal `biliMsgIds` array parallel to `messages` that pins message identity to client-supplied ids (always stripped before upstream forwarding; malformed arrays are ignored with a warning, id-poisoning shapes hard-fail on the incremental lane); (b) the loopback-only `POST /__bili/plugin/render` endpoint serves the outbound prefix rendered from the unified transcript (folded regions collapse to summary anchors; any desync degrades to a non-2xx so the shim falls back to its local history); (c) the incremental-lane probe advertises `serverHistory`. Default 0% — no behavior change until rolled out. |
| `rollout.features.pluginFullResendWatermark` | boolean \| number | 5 (experimental grey) | BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK | Full-resend watermark fastpath (#5403/#5418): plugin-lane chat-completions turns whose previous response carried an x-bili-pf-seq stamp assert the resent prefix via the echoed count (structural scan, no full parse); on a hit the pipeline consumes stashed canonical prefix cores plus only the new tail window (byte-identical outbound provenance; ANY doubt falls back to the untouched full-parse path per turn and re-stamps, five credited misses hold the lane for one hour). Requires the client to echo the stamp back as x-bili-pf-count (dsh/pi/opencode/omp do; unadapted lanes never hit). EXPERIMENTAL grey rollout — ON by default for roughly 5% of installs (owner ruling 2026-11-02: small cohort before GA; one-time intro notice in the web UI for every install, tri-state switch in quick config). Force it with `true`, turn off with `false` (or a percent) / env = 0. See technical-notes.md “Full-resend watermark fastpath”. |
| `rollout.features.pluginIncrementalTurns` | boolean \| number | 100 (on) | BILI_ROLLOUT_PLUGIN_INCREMENTAL_TURNS | Incremental turn lane (#3248): for enabled installs, native plugin hosts send only the conversation delta each turn (with the host-msgid envelope) instead of re-sending the whole history; bili rebuilds the outbound request from the unified transcript through the normal fold/render pipeline. GA since this version — fresh installs are delta-by-default. Installs without the unified-storage sidecar stay on full-resend automatically (probe reports storage=legacy-only). Opt out with false / a percent override, or BILI_ROLLOUT_PLUGIN_INCREMENTAL_TURNS=0. |
| `maskHosts` | boolean | true | BILI_LOG_MASK_HOSTS | Mask non-public target hosts in logs as <private-host>; credential headers are always masked regardless. |
| `security.adminRelay` | boolean | false | — | Let an embedding host (dsh web today) relay the ENTIRE /__bili/ admin surface through its own entry origin so a remote browser can open the panel (#3373). Fail-closed, file-only. The relayed hop reaches the proxy as a local non-browser client (loopback source + loopback Host, no Origin), so the admin gate stays unchanged; enabling it exposes config editing and credential writes to whoever can reach the host web entry — protect that entry (auth / reverse proxy) first. |
| `subagentSplit` | boolean | true | BILI_SUBAGENT_SPLIT | Claude Code subagents get their own session namespace (<session>\|sub:<agent-id>) instead of queueing behind the main session. Anthropic-wire only — on the Responses wire this switch is a no-op (see the `subagentSplit` / BOTH-mechanisms scope note). |
Expand Down Expand Up @@ -2034,6 +2035,7 @@ File keys resolve only when the matching env var is unset. Defaults in parenthes
| `BILI_ROLLOUT_<FEATURE>` | `rollout.features.enabled` | unset (bucket math decides) |
| `BILI_ROLLOUT_IDENTITY_CHANNEL_HARVEST` | `rollout.features.identityChannelHarvest` | 0 (off) |
| `BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK` | `rollout.features.pluginFullResendWatermark` | 5 (experimental grey) |
| `BILI_ROLLOUT_PLUGIN_INCREMENTAL_TURNS` | `rollout.features.pluginIncrementalTurns` | 100 (on) |
| `BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY` | `rollout.features.pluginLaneServerHistory` | 0 (off) |
| `BILI_SESSION_CONTENT_STORE_PIN` | `sessions.contentStorePin` | false |
| `BILI_SESSION_GC` | `sessions.gc.enabled` | false |
Expand Down
Loading
Loading