Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/configuration.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@
| `compat.streamErrorShape` | "protocol" \| "completion" | protocol | BILI_STREAM_ERROR_SHAPE | 200 がコミットされた後、上流ストリーム失敗がどのように提示されるか:プロトコルネイティブのエラーフレーム(デフォルト)またはレガシーの合成完了形状。 |
| `compat.noCacheControl` | boolean | false | BILI_NO_CACHE_CONTROL | Anthropic レーンの cache_control ブレークポイントを完全にスタンプしないようにします(独自のブレークポイントポリシーを持つ上流/リレー用のエスケープハッチ)。 |
| `compat.keepResponseId` | boolean | false | ACP_KEEP_RESPONSE_ID | カーネル再構築された Responses リクエストで previous_response_id を保持します(デフォルトでは削除するため、再構築されたボディは上流が発行したことのない ID を参照しません)。 |
| `dsh` | object | {} | BILI_ALLOW_DSH_COMPACTION | セクションは認識されるが、従来のエスケープハッチは削除された(#3666、#2028 を代替):`allowDshCompaction` キーおよび `BILI_ALLOW_DSH_COMPACTION` 環境変数はもはや存在しない — dsh ネイティブコンパクションは、すべてのレーンにおいてワイヤガードによって無条件に拒否される。残存する `dsh.allowDshCompaction` の値は、一度限りの非推奨警告とともに無視される;代わりにホスト側の抑制を適用すること(#3354/#2474)。ライブキー — `dsh.authoredCompaction`、`dsh.contextTab`、`dsh.contextTabLabel` — は以下のエントリに文書化されている。 |
| `dsh` | object | {} | BILI_ALLOW_DSH_COMPACTION | セクションは認識されるが、従来のエスケープハッチは削除された(#3666、#2028 を代替):`allowDshCompaction` キーおよび `BILI_ALLOW_DSH_COMPACTION` 環境変数はもはや存在しない — dsh ネイティブコンパクションは、すべてのレーンにおいてワイヤガードによって無条件に拒否される。残存する `dsh.allowDshCompaction` の値は、一度限りの非推奨警告とともに無視される;代わりにホスト側の抑制を適用すること(#3354/#2474)。ライブキー — `dsh.authoredCompaction`、`dsh.contextTab`、`dsh.contextTabLabel`、`dsh.settingsTab` — は以下のエントリに文書化されている。 |
| `dsh.authoredCompaction` | boolean | true (on, #3901 flip) | BILI_DSH_AUTHORED_COMPACTION | bili は dsh コンパクションの summarize 呼び出しを、拒否する代わりに折り畳みスナップショットでローカルに回答する(#3723/#3733)。0.1.203 のドッグフッド期間が維持されたため、デフォルトで ON。`false`(または環境変数 `BILI_DSH_AUTHORED_COMPACTION=0`)を設定すると、#1729 の拒否パスが復元される。 |
| `dsh.contextTab` | boolean | true | BILI_DSH_CONTEXT_TAB | DSH トップバーの「上下文」/「Context」会話タブを登録する(#3862/#4237):`false` にすると、そのタブのみが削除される — コンプレッション、設定セクション、その他のすべてのサーフェスは引き続き動作する。非表示にしてもコンプレッションは無効にならない;台帳は設定セクション(会话 サブページ)、プラグインバンドル設定フェイス、Web UI、および `/acp` コマンド経由で引き続きアクセス可能。次のページ読み込み / dsh リスタート時に有効になる(スロット登録はページ読み込み時に発生);デフォルト `true` = 現在の動作は変更なし。 |
| `dsh.contextTabLabel` | string | unset (built-in 「上下文」/「Context」) | — | DSH トップバーの Context タブのカスタム表示名(#4237)、例:別のプラグイン(dsh-context)が「上下文」の名前を所有している場合の "压缩账本"。トリムされた空でない文字列が組み込みラベルに優先される;空白または未設定の場合は組み込みにフォールバック。ファイル専用ティア(表示設定、#2030 に従い環境変数なし)。デフォルト未設定 = 組み込みラベルは変更なし。 |
| `dsh.settingsTab` | boolean | true | — | DSH 設定ページの bili セクションを登録する(#6436):`false` にすると、そのナビゲーションエントリのみが削除される — コンプレッション、Context タブ、プラグインバンドル設定フェイス、Web UI は引き続き動作し、パネルはプラグイン詳細ページと bili Web UI から引き続きアクセス可能。次のページ読み込み / dsh リスタート時に有効になる(スロット登録はページ読み込み時に発生)。ファイル専用ティア(表示設定、#2030 に従い環境変数なし)。デフォルト `true` = 現在の動作は変更なし。 |
| `resign` | scheme → { enabled?, passthrough?, credentialRef? } | {} (armed; built-in scheme sdk-hmac-sha256) | BILI_RESIGN, BILI_RESIGN_PASSTHROUGH, BILI_CODEARTS_REF, BILI_RESIGN_BENEFIT | Authorization スキームでキーイングされた再署名アーム:署名済みモデルリクエストは、すべてのエグレスボディが再署名されてトンネリングされる;署名解除できないリクエストは、パススルーがそのスキームを逐語転送にオプトインしていない限り、ローカルで 403 として拒否される。 |
| `promptCache.routing` | "auto" \| "enabled" \| "disabled" | disabled | ACP_PROMPT_CACHE_ROUTING | bili 自身の `prompt_cache_key` 出力の姿勢(両方のワイヤ);クライアントが供給したキーは常に逐語的に転送される。 |
| `cacheKeepalive.enabled` | boolean | false | BILI_CACHE_KEEPALIVE | Anthropic ワイヤにおけるアイドル時のプロンプトキャッシュキープアライブのマスタースイッチ(#3376):セッションがアイドルになると、bili は TTL 由来の周期で `max_tokens=1` を伴う最後の転送ボディを再生し、アップストリームのプレフィックスキャッシュをウォームに保つ;ヒットは `usage.cache_read_input_tokens` 経由で検証される;ミス/429/エラー連続/期間上限で停止。プロバイダルートごとおよびモデルごとにも設定可能。 |
Expand Down
3 changes: 2 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ This index is generated from `website/config-reference/*.yaml` — edit the seed
| `compat.streamErrorShape` | "protocol" \| "completion" | protocol | BILI_STREAM_ERROR_SHAPE | How upstream stream failures are presented after the 200 is committed: protocol-native error frames (default) or the legacy synthesized-completion shape. |
| `compat.noCacheControl` | boolean | false | BILI_NO_CACHE_CONTROL | Stop stamping Anthropic-lane cache_control breakpoints entirely (escape hatch for upstreams/relays with their own breakpoint policy). |
| `compat.keepResponseId` | boolean | false | ACP_KEEP_RESPONSE_ID | Preserve previous_response_id on kernel-rebuilt Responses requests (default strips it so rebuilt bodies never reference ids the upstream never issued). |
| `dsh` | object | {} | BILI_ALLOW_DSH_COMPACTION | Section recognized but its former escape hatch is gone (#3666, superseding #2028): the allowDshCompaction key and the BILI_ALLOW_DSH_COMPACTION env var no longer exist — dsh native compaction is refused unconditionally by the wire guard on every lane. Leftover dsh.allowDshCompaction values are ignored with a one-time deprecation warning; apply host-side suppression instead (#3354/#2474). The live keys — dsh.authoredCompaction, dsh.contextTab, dsh.contextTabLabel — are documented in the following entries. |
| `dsh` | object | {} | BILI_ALLOW_DSH_COMPACTION | Section recognized but its former escape hatch is gone (#3666, superseding #2028): the allowDshCompaction key and the BILI_ALLOW_DSH_COMPACTION env var no longer exist — dsh native compaction is refused unconditionally by the wire guard on every lane. Leftover dsh.allowDshCompaction values are ignored with a one-time deprecation warning; apply host-side suppression instead (#3354/#2474). The live keys — dsh.authoredCompaction, dsh.contextTab, dsh.contextTabLabel, dsh.settingsTab — are documented in the following entries. |
| `dsh.authoredCompaction` | boolean | true (on, #3901 flip) | BILI_DSH_AUTHORED_COMPACTION | bili answers dsh compaction summarize calls locally with the folded snapshot instead of refusing (#3723/#3733). ON by default since the 0.1.203 dogfood window held; false (or env BILI_DSH_AUTHORED_COMPACTION=0) restores the #1729 refusal path. |
| `dsh.contextTab` | boolean | true | BILI_DSH_CONTEXT_TAB | Registers the DSH top-bar 「上下文」/「Context」 conversation tab at all (#3862/#4237): false removes ONLY that tab — compression, the settings section and every other surface keep working. Hiding never disables compression; the ledger stays reachable via the settings section (会话 subpage), the plugin bundle config face, the Web UI and the /acp command. Takes effect on the next page load / dsh restart (slot registration happens at page load); default true = today's behavior unchanged. |
| `dsh.contextTabLabel` | string | unset (built-in 「上下文」/「Context」) | — | Custom display name for the DSH top-bar Context tab (#4237), e.g. "压缩账本" when another plugin (dsh-context) owns the name 「上下文」. Trimmed non-empty string wins over the built-in label; blank or absent falls back to the built-in. File-only tier (display preference, no env knob per #2030). Default unset = built-in label unchanged. |
| `dsh.settingsTab` | boolean | true | — | Registers the bili section on the DSH settings page (#6436): false removes ONLY that navigation entry — compression, the Context tab, the plugin bundle config face and the Web UI keep working, so the panel stays reachable from the plugin detail page and the bili Web UI. Takes effect on the next page load / dsh restart (slot registration happens at page load). File-only tier (display preference, no env knob per #2030). Default true = today's behavior unchanged. |
| `resign` | scheme → { enabled?, passthrough?, credentialRef? } | {} (armed; built-in scheme sdk-hmac-sha256) | BILI_RESIGN, BILI_RESIGN_PASSTHROUGH, BILI_CODEARTS_REF, BILI_RESIGN_BENEFIT | Re-sign arm keyed by Authorization scheme: signed model requests tunnel with every egress body re-signed; unresignable requests are refused locally 403 unless passthrough opts that scheme into verbatim forwarding. |
| `promptCache.routing` | "auto" \| "enabled" \| "disabled" | disabled | ACP_PROMPT_CACHE_ROUTING | Posture of bili's own `prompt_cache_key` emission (both wires); client-supplied keys always forward verbatim. |
| `cacheKeepalive.enabled` | boolean | false | BILI_CACHE_KEEPALIVE | Master switch for idle prompt-cache keepalive on the Anthropic wire (#3376): while a session goes idle, bili replays the last forwarded body with max_tokens=1 on a TTL-derived cadence so the upstream prefix cache stays warm; hits are verified via usage.cache_read_input_tokens; stops on miss/429/error-streak/duration cap. Also settable per provider route and per model. |
Expand Down
3 changes: 2 additions & 1 deletion docs/configuration.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@
| `compat.streamErrorShape` | "protocol" \| "completion" | protocol | BILI_STREAM_ERROR_SHAPE | 200 已提交后上游流失败的呈现方式:协议原生错误帧(默认)或旧版合成完成形态。 |
| `compat.noCacheControl` | boolean | false | BILI_NO_CACHE_CONTROL | 完全停止 Anthropic 通道的 cache_control 断点打标(面向拒收该字段或有自有断点策略的上游/中继的逃生门)。 |
| `compat.keepResponseId` | boolean | false | ACP_KEEP_RESPONSE_ID | 在内核重建的 Responses 请求上保留 previous_response_id(默认剔除,使重建请求体永不引用上游从未签发过的响应 id)。 |
| `dsh` | object | {} | BILI_ALLOW_DSH_COMPACTION | 段仍被识别,但其原逃生门已移除(#3666,取代 #2028):allowDshCompaction 键与 BILI_ALLOW_DSH_COMPACTION 环境变量已不存在——dsh 原生压缩现在在所有线路上被无条件拒绝。遗留的 dsh.allowDshCompaction 取值会被忽略(一次性弃用警告);请改用宿主侧抑制(#3354/#2474)。存活的键——dsh.authoredCompaction、dsh.contextTab、dsh.contextTabLabel——见接下来的条目。 |
| `dsh` | object | {} | BILI_ALLOW_DSH_COMPACTION | 段仍被识别,但其原逃生门已移除(#3666,取代 #2028):allowDshCompaction 键与 BILI_ALLOW_DSH_COMPACTION 环境变量已不存在——dsh 原生压缩现在在所有线路上被无条件拒绝。遗留的 dsh.allowDshCompaction 取值会被忽略(一次性弃用警告);请改用宿主侧抑制(#3354/#2474)。存活的键——dsh.authoredCompaction、dsh.contextTab、dsh.contextTabLabel、dsh.settingsTab——见接下来的条目。 |
| `dsh.authoredCompaction` | boolean | true (on, #3901 flip) | BILI_DSH_AUTHORED_COMPACTION | bili 用折叠快照本地应答 dsh 压缩摘要请求而非拒绝(#3723/#3733)。0.1.203 狗粮窗口守住后默认开启;false(或环境变量 BILI_DSH_AUTHORED_COMPACTION=0)恢复 #1729 拒绝路径。 |
| `dsh.contextTab` | boolean | true | BILI_DSH_CONTEXT_TAB | 是否注册 DSH 顶栏「上下文」会话标签页(#3862/#4237):false 只移除该标签页——压缩、设置页一节及其余所有入口不受影响。隐藏绝不关闭压缩;账本仍可从设置页(会话子页)、插件 bundle 配置面、Web UI 与 /acp 命令查看。下次页面加载 / dsh 重启生效(槽位注册发生在页面加载时);默认 true = 现状不变。 |
| `dsh.contextTabLabel` | string | unset (built-in 「上下文」/「Context」) | — | DSH 顶栏上下文标签页的自定义显示名(#4237),例如另一插件(dsh-context)已占用「上下文」时改为"压缩账本"。去空白后的非空字符串优先于内置名;留空或缺省回退内置名。仅文件层(显示偏好,按 #2030 不设 env 开关)。默认缺省 = 内置名不变。 |
| `dsh.settingsTab` | boolean | true | — | 是否在 DSH 设置页注册 bili 一节(#6436):false 只移除该导航入口——压缩、上下文标签页、插件 bundle 配置面与 Web UI 均不受影响,设置面板仍可从插件详情页与 bili Web UI 打开。下次页面加载 / dsh 重启生效(槽位注册发生在页面加载时)。仅文件层(显示偏好,按 #2030 不设 env 开关)。默认 true = 现状不变。 |
| `resign` | scheme → { enabled?, passthrough?, credentialRef? } | {} (armed; built-in scheme sdk-hmac-sha256) | BILI_RESIGN, BILI_RESIGN_PASSTHROUGH, BILI_CODEARTS_REF, BILI_RESIGN_BENEFIT | 按 Authorization 方案键控的重签名臂:可重签名的模型请求全程重签转发;无法重签的请求本地 403 拒绝,除非该方案经 passthrough 选择原文透传。 |
| `promptCache.routing` | "auto" \| "enabled" \| "disabled" | disabled | ACP_PROMPT_CACHE_ROUTING | bili 自注入 `prompt_cache_key` 的姿态(两条 wire 同时生效);客户端自带的 key 永远原样转发。 |
| `cacheKeepalive.enabled` | boolean | false | BILI_CACHE_KEEPALIVE | Anthropic 线路空闲期提示缓存保活总开关(#3376):会话空闲时按 TTL 推导的节奏以 max_tokens=1 重放最后一次转发的请求体,维持上游前缀缓存温热;以 usage.cache_read_input_tokens 验证命中,miss/429/连续错误/时长上限即停;支持逐 provider 路由与逐模型覆盖。 |
Expand Down
27 changes: 23 additions & 4 deletions src/agent/dsh-native-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,18 @@ function readCtxTabFace(): { hidden: boolean; label: string | undefined } {
return { hidden, label };
}

/** #6436: settings-section face flag from the __BILI__ snapshot (host half,
* dsh.settingsTab). `hidden` skips the settings.section registration — only
* the DSH settings navigation entry goes away; the panel stays mounted at
* plugins.bundle.config and reachable through the Web UI. Fails open: an
* absent field (legacy host, pre-bootstrap page load) keeps today's
* registration byte-identical. */
function readSettingsTabFace(): { hidden: boolean } {
const g = globalThis as { __BILI__?: { settingsTab?: unknown } };
const snap = g.__BILI__;
return { hidden: snap !== undefined && snap.settingsTab === false };
}

function openExternal(url: string): void {
const w = globalThis as { open?: (url: string, target?: string, features?: string) => unknown };
if (typeof w.open === "function") w.open(url, "_blank", "noopener,noreferrer");
Expand Down Expand Up @@ -1141,10 +1153,17 @@ export function apply(ctx: ClientContext): void {
}),
);
};
ctx.slots.inject(
"settings.section",
() => ctx.slots.register({ name: "settings.section", id: "bili", order: 100, label: () => t("nav"), locale: NS }, panel(true)),
);
// #6436: dsh.settingsTab=false (config file / web settings) skips the
// settings.section registration — only the DSH settings navigation entry
// goes away; the ledger stays reachable through the plugin bundle config
// face and the Web UI. Fail-open on an absent flag.
const settingsGate = readSettingsTabFace();
if (!settingsGate.hidden) {
ctx.slots.inject(
"settings.section",
() => ctx.slots.register({ name: "settings.section", id: "bili", order: 100, label: () => t("nav"), locale: NS }, panel(true)),
);
}
ctx.slots.inject(
"plugins.bundle.config",
() => ctx.slots.register({ name: "plugins.bundle.config", key: "billion-context", locale: NS }, panel(false)),
Expand Down
Loading
Loading