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
6 changes: 3 additions & 3 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ This index is generated from `website/config-reference/*.yaml` — edit the seed
| `fakeCompletion` | object | {} (all defaults) | — | Retry loop that re-requests when a final chunk arrives truncated. |
| `fakeCompletion.retries` | number | 0 (opt-in) | BILI_FAKE_COMPLETION_RETRIES | How many times a truncated final completion may be re-requested; 0 disables the loop. |
| `fakeCompletion.bufCapBytes` | number | 16777216 | BILI_FAKE_BUF_CAP | Buffer size cap for the retry loop's accumulated stream. |
| `codexCompact` | "intercept" \| "pass" | "intercept" | BILI_CODEX_COMPACT | Handle Codex's compaction requests inside bili (intercept, default) or forward them upstream (pass): the explicit forms (compaction_trigger + /responses/compact) and the inline auto-compact that transits as an ordinary turn, detected by its SUMMARIZATION_PROMPT template (#3008) — a user-overridden compact_prompt falls out of detection and transits verbatim; a compaction bili only observed (pass/gate) is rebased post-hoc (#2372). |
| `codexCompact` | "intercept" \| "pass" | "intercept" | BILI_CODEX_COMPACT | Handle Codex's compaction requests inside bili (intercept, default) or forward them upstream (pass): the explicit forms (compaction_trigger + /responses/compact) and the inline auto-compact that transits as an ordinary turn, detected by its SUMMARIZATION_PROMPT template (#3008) — a user-overridden compact_prompt falls out of detection and transits verbatim; a compaction bili only observed (pass/gate) is rebased post-hoc (#2372). The forged handoff is coverage-complete (#4035): besides the active block summaries it carries the recent work since the last fold (the uncovered tail) — trigger form as structured items in the v2 blob envelope (expanded on echo), prompt form rendered into the adopted summary text. |
| `ccrRetrievalTtlMs` | number | 600000 (0 disables retrieval) | BILI_CCR_RETRIEVAL_TTL_MS | Lifetime of CCR retrieval pointers before originals stop being fetchable via acp_retrieve. |
| `decompressTmpCap` | number | 50 | BILI_DECOMPRESS_TMP_CAP | Size cap (blocks) for temporary decompressed content held in-session. |

Expand Down Expand Up @@ -977,7 +977,7 @@ Security boundary: the file controls ONLY *when* to upgrade and *which published
- **Type:** `string` ("intercept" | "pass") / `number` / `number`
- **Default:** `"intercept"` / `600000` / `50`
- **Status:** ACTIVE
- **Description:** Top-level scalars. `codexCompact`: whether bili intercepts codex native-compaction requests and forges a local ACP handoff, or passes them upstream (twin `BILI_CODEX_COMPACT`; read per request, so either tier flips without restart). Scope (#3008): interception covers the explicit forms (the `/compact` trigger item and `POST /responses/compact`) and the inline auto-compact that transits as an ordinary turn, detected by its SUMMARIZATION_PROMPT template; a user-overridden compact_prompt falls out of detection and transits verbatim. Compaction bili only observed (pass mode / gate refusal) is rebased post-hoc onto the compacted history (#2372). `ccrRetrievalTtlMs`: expiry for queued-but-undelivered `acp_retrieve` injections, dropped loudly on expiry (twin `BILI_CCR_RETRIEVAL_TTL_MS`; `0` disables). `decompressTmpCap`: max concurrent decompress temp files (twin `BILI_DECOMPRESS_TMP_CAP`).
- **Description:** Top-level scalars. `codexCompact`: whether bili intercepts codex native-compaction requests and forges a local ACP handoff, or passes them upstream (twin `BILI_CODEX_COMPACT`; read per request, so either tier flips without restart). Scope (#3008): interception covers the explicit forms (the `/compact` trigger item and `POST /responses/compact`) and the inline auto-compact that transits as an ordinary turn, detected by its SUMMARIZATION_PROMPT template; a user-overridden compact_prompt falls out of detection and transits verbatim. Compaction bili only observed (pass mode / gate refusal) is rebased post-hoc onto the compacted history (#2372). The forged local handoff is coverage-complete (#4035): in addition to the active-block summaries, the recent work between the last fold and compaction time (the uncompressed tail — assistant progress, tool drafts/results) rides in the forged response — trigger form as structured items inside the forged compaction blob (v2 JSON envelope, expanded back in place on echo, deduping copies codex itself still retains), prompt form rendered as a labeled section inside the adopted summary text; pre-#4035 only the summaries were handed off and the unfolded tail was silently lost from the model's view after a local forge compaction. `ccrRetrievalTtlMs`: expiry for queued-but-undelivered `acp_retrieve` injections, dropped loudly on expiry (twin `BILI_CCR_RETRIEVAL_TTL_MS`; `0` disables). `decompressTmpCap`: max concurrent decompress temp files (twin `BILI_DECOMPRESS_TMP_CAP`).

Three more #2030 keys extend existing blocks: [`mitm.handshakeTimeoutMs`](#client-integration) (default `10000`, twin `BILI_MITM_HANDSHAKE_TIMEOUT_MS`), [`compat.noCacheControl`](#compat), and [`compat.keepResponseId`](#compat).

Expand Down Expand Up @@ -1925,7 +1925,7 @@ File keys resolve only when the matching env var is unset. Defaults in parenthes
| `BILI_ZCODE_SIGNING_FIXED` | `1`/`true` = assume your ZCode build fixed ClientRequestSigningV4 (#1621): the per-entry skips for coding-plan accounts on v3.14+ personal stores flip off and they route again. Temporary escape hatch — there is **no** file equivalent. |
| `BILI_CLAUDE_UPSTREAM` | claude direct mode: your relay endpoint, when `ANTHROPIC_BASE_URL` already points at a relay the launcher would otherwise bypass. |
| `BILI_CLAUDE_NATIVE_PORT` | Pin an **exact** port for the claude native lane's hook-spawned proxy (#964/#1660): strict-port semantics — a squatter on the port is refused loudly instead of hopping — and the baked managed `ANTHROPIC_BASE_URL` points at it. Without it the hook rides the self-managed zone (`BILI_ZONE_PORT` base + per-lane sticky) and re-pins the managed URL to the live origin each session, so port drift self-heals (#1660). |
| `BILI_CODEX_COMPACT` | Codex native-compaction handling. Default `intercept`: bili intercepts codex's compaction requests and forges a local handoff to the ACP state when the safety gate passes (transform ok + steady-state usage < 90% of the window + at least one active compressed block) — trigger form forges a 2-frame SSE, endpoint form forges `{output}` — and never contacts upstream. Scope (#3008): covers the explicit forms (compaction_trigger + /responses/compact) and the inline auto-compact that transits as an ordinary turn, detected by its SUMMARIZATION_PROMPT template — a user-overridden compact_prompt falls out of detection and transits verbatim; a compaction bili only observed (pass/gate) is rebased post-hoc (#2372). Forged ACP summaries are re-injected as a history-borne handoff message (developer-message fallback) so compressed content stays visible after codex truncates its history. Set `pass` to opt out and forward codex's compaction requests upstream (native compaction backstops). On any gate failure the request passes through untouched. Codex client detection (which traffic this applies to, also used for window clamping and session-identity fingerprinting): the User-Agent must either start with a registered prefix (`codex_cli_rs/`, `codex_exec/`, `codex desktop/` — matched case-insensitively, since variants like Codex Desktop send an initial capital, #1169) or contain a whitespace-delimited component starting with lowercase `codex` (unknown variants such as `codex_sdk_ts/…`, #645 — narrowed from a bare substring to a token-level prefix in #1641 so non-codex clients whose UAs merely mention "codex" mid-token or in parens are no longer misclassified; the fallback stays case-sensitive on purpose so "Codex"-shaped relays are excluded, #1106). |
| `BILI_CODEX_COMPACT` | Codex native-compaction handling. Default `intercept`: bili intercepts codex's compaction requests and forges a local handoff to the ACP state when the safety gate passes (transform ok + steady-state usage < 90% of the window + at least one active compressed block) — trigger form forges a 2-frame SSE, endpoint form forges `{output}` — and never contacts upstream. Scope (#3008): covers the explicit forms (compaction_trigger + /responses/compact) and the inline auto-compact that transits as an ordinary turn, detected by its SUMMARIZATION_PROMPT template — a user-overridden compact_prompt falls out of detection and transits verbatim; a compaction bili only observed (pass/gate) is rebased post-hoc (#2372). Forged ACP summaries are re-injected as a history-borne handoff message (developer-message fallback) so compressed content stays visible after codex truncates its history. The forged handoff is coverage-complete (#4035): it carries not only the active-block summaries but also the recent work since the last fold (uncompressed tail) — trigger form as structured items in the forged compaction blob (v2 envelope, expanded on echo), prompt form rendered into the adopted summary text — so a local forge compaction no longer silently drops recent progress/drafts from the model's view (codex's own retention keeps only user messages). Set `pass` to opt out and forward codex's compaction requests upstream (native compaction backstops). On any gate failure the request passes through untouched. Codex client detection (which traffic this applies to, also used for window clamping and session-identity fingerprinting): the User-Agent must either start with a registered prefix (`codex_cli_rs/`, `codex_exec/`, `codex desktop/` — matched case-insensitively, since variants like Codex Desktop send an initial capital, #1169) or contain a whitespace-delimited component starting with lowercase `codex` (unknown variants such as `codex_sdk_ts/…`, #645 — narrowed from a bare substring to a token-level prefix in #1641 so non-codex clients whose UAs merely mention "codex" mid-token or in parens are no longer misclassified; the fallback stays case-sensitive on purpose so "Codex"-shaped relays are excluded, #1106). |

---

Expand Down
6 changes: 3 additions & 3 deletions CONFIGURATION.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
| `fakeCompletion` | object | {} (all defaults) | — | 末块被截断时重新发起请求的重试环。 |
| `fakeCompletion.retries` | number | 0 (opt-in) | BILI_FAKE_COMPLETION_RETRIES | 被截断的末块完成可被重新请求的次数;0 禁用该重试环。 |
| `fakeCompletion.bufCapBytes` | number | 16777216 | BILI_FAKE_BUF_CAP | 重试环累积流缓冲的大小上限。 |
| `codexCompact` | "intercept" \| "pass" | "intercept" | BILI_CODEX_COMPACT | 在 bili 内处理 Codex 的压缩请求(intercept,默认)还是转给上游(pass):覆盖显式形态(compaction_trigger + /responses/compact)与以普通请求形态过线的内联自动压缩(按 SUMMARIZATION_PROMPT 模板检测,#3008)—— 用户自定义 compact_prompt 后锚点失配、按原样转发;bili 仅旁路观察到的压缩(pass/安全阀放行)走事后 rebase(#2372)。 |
| `codexCompact` | "intercept" \| "pass" | "intercept" | BILI_CODEX_COMPACT | 在 bili 内处理 Codex 的压缩请求(intercept,默认)还是转给上游(pass):覆盖显式形态(compaction_trigger + /responses/compact)与以普通请求形态过线的内联自动压缩(按 SUMMARIZATION_PROMPT 模板检测,#3008)—— 用户自定义 compact_prompt 后锚点失配、按原样转发;bili 仅旁路观察到的压缩(pass/安全阀放行)走事后 rebase(#2372)。伪造交接是覆盖完整的(#4035):除活跃块摘要外,还携带上次折叠以来的近期工作(未压缩尾巴)——trigger 形态以结构化条目放进 v2 blob 信封(回显时展开),prompt 形态渲染进被采纳的摘要文本。 |
| `ccrRetrievalTtlMs` | number | 600000 (0 disables retrieval) | BILI_CCR_RETRIEVAL_TTL_MS | CCR 回取指针的有效期,过期后原文不再可通过 acp_retrieve 取回。 |
| `decompressTmpCap` | number | 50 | BILI_DECOMPRESS_TMP_CAP | 会话内临时展开内容的大小上限(按块计)。 |

Expand Down Expand Up @@ -977,7 +977,7 @@
- **类型:** `string`("intercept" | "pass")/ `number` / `number`
- **默认:** `"intercept"` / `600000` / `50`
- **状态:** ACTIVE
- **说明:** 顶层标量。`codexCompact`:bili 是否拦截 codex 原生 compaction 请求并本地伪造 ACP 交接,还是放行到上游(对应 `BILI_CODEX_COMPACT`;按请求读取,两层任一改动都无需重启)。作用范围(#3008):覆盖显式形态(`/compact` 触发的 `compaction_trigger` 与 `POST /responses/compact`)与以普通请求形态过线的内联自动压缩(按 SUMMARIZATION_PROMPT 模板检测);用户自定义 compact_prompt 后锚点失配、按原样转发。bili 仅旁路观察到的压缩(pass/安全阀放行)走事后 rebase(#2372)。`ccrRetrievalTtlMs`:排队未送达的 `acp_retrieve` 注入的过期时限,过期大声丢弃(对应 `BILI_CCR_RETRIEVAL_TTL_MS`;`0` 禁用)。`decompressTmpCap`:并发 decompress 临时文件上限(对应 `BILI_DECOMPRESS_TMP_CAP`)。
- **说明:** 顶层标量。`codexCompact`:bili 是否拦截 codex 原生 compaction 请求并本地伪造 ACP 交接,还是放行到上游(对应 `BILI_CODEX_COMPACT`;按请求读取,两层任一改动都无需重启)。作用范围(#3008):覆盖显式形态(`/compact` 触发的 `compaction_trigger` 与 `POST /responses/compact`)与以普通请求形态过线的内联自动压缩(按 SUMMARIZATION_PROMPT 模板检测);用户自定义 compact_prompt 后锚点失配、按原样转发。bili 仅旁路观察到的压缩(pass/安全阀放行)走事后 rebase(#2372)。本地伪造交接是覆盖完整的(#4035):除活跃块摘要外,上次折叠到压缩时刻之间的近期工作(未压缩尾巴——助手进展、工具草稿/结果)随伪造响应携带——trigger 形态作为结构化条目放进伪造的 compaction blob(v2 JSON 信封,回显时就地展开,并去重 codex 自身仍保留的副本),prompt 形态渲染为被采纳摘要文本中的带标签小节;#4035 之前只交接摘要,未折叠的尾巴会在本地伪造压缩后从模型视野中静默丢失。`ccrRetrievalTtlMs`:排队未送达的 `acp_retrieve` 注入的过期时限,过期大声丢弃(对应 `BILI_CCR_RETRIEVAL_TTL_MS`;`0` 禁用)。`decompressTmpCap`:并发 decompress 临时文件上限(对应 `BILI_DECOMPRESS_TMP_CAP`)。

另有三个 #2030 键扩展了既有块:[`mitm.handshakeTimeoutMs`](#客户端接入)(默认 `10000`,对应 `BILI_MITM_HANDSHAKE_TIMEOUT_MS`)、[`compat.noCacheControl`](#compat)、[`compat.keepResponseId`](#compat)。

Expand Down Expand Up @@ -1919,7 +1919,7 @@ ACP 原生 agent(当前为 `pi` 扩展)会在每个进程内向代理上报
| `BILI_ZCODE_SIGNING_FIXED` | `1`/`true` = 假设你的 ZCode 构建已修复 ClientRequestSigningV4(#1621):v3.14+ personal store 上 coding-plan 账号的逐条跳过关闭,恢复路由。临时逃生舱 —— **没有**文件等效项。 |
| `BILI_CLAUDE_UPSTREAM` | claude 直连模式:当 `ANTHROPIC_BASE_URL` 已指向某个 relay 时,用它指定你的 relay 端点(否则会被旁路)。 |
| `BILI_CLAUDE_NATIVE_PORT` | 为 claude 原生通道 hook 拉起的代理钉死**确切端口**(#964/#1660):严格端口语义——口上的占用者被大声拒绝而不是跳口——烘进受管 `ANTHROPIC_BASE_URL`。不设则 hook 骑自管区(`BILI_ZONE_PORT` 基准 + 每 lane 粘性),且每次会话把受管 URL 重钉到存活 origin,端口漂移自愈(#1660)。 |
| `BILI_CODEX_COMPACT` | codex 原生压缩处理。默认 `intercept`:安全门通过时(transform 成功 + 稳态用量 < 窗口 90% + 至少一个活跃压缩块)拦截 codex 的压缩请求,在本地伪造向 ACP 状态的交接——trigger 形态伪造 2 帧 SSE,endpoint 形态伪造 `{output}`——且不接触上游。作用范围(#3008):覆盖显式形态(compaction_trigger + /responses/compact)与以普通请求形态过线的内联自动压缩(按 SUMMARIZATION_PROMPT 模板检测)——用户自定义 compact_prompt 后锚点失配、按原样转发;bili 仅旁路观察到的压缩(pass/安全阀放行)走事后 rebase(#2372)。伪造的 ACP 摘要经历史承载交接消息注入(缺席时 developer 消息兜底),保证 codex 截断历史后压缩内容仍可见。设为 `pass` 可退出,把 codex 的压缩请求转发给上游(原生压缩兜底)。任一安全门失败则原样透传。codex 客户端判定(本项生效范围,同时用于窗口 clamp 与会话身份指纹):User-Agent 须以已注册前缀开头(`codex_cli_rs/`、`codex_exec/`、`codex desktop/`——大小写不敏感,因 Codex Desktop 等变体首字母大写,#1169),或含某个以**小写** `codex` 开头的空白分隔组件(未知变体如 `codex_sdk_ts/…`,#645——#1641 起从裸子串收窄为 token 级前缀,UA 中仅在括号内/路径段提及 "codex" 的非 codex 客户端不再被误判;兜底有意保持大小写敏感,排除 "Codex"-形中继,#1106)。 |
| `BILI_CODEX_COMPACT` | codex 原生压缩处理。默认 `intercept`:安全门通过时(transform 成功 + 稳态用量 < 窗口 90% + 至少一个活跃压缩块)拦截 codex 的压缩请求,在本地伪造向 ACP 状态的交接——trigger 形态伪造 2 帧 SSE,endpoint 形态伪造 `{output}`——且不接触上游。作用范围(#3008):覆盖显式形态(compaction_trigger + /responses/compact)与以普通请求形态过线的内联自动压缩(按 SUMMARIZATION_PROMPT 模板检测)——用户自定义 compact_prompt 后锚点失配、按原样转发;bili 仅旁路观察到的压缩(pass/安全阀放行)走事后 rebase(#2372)。伪造的 ACP 摘要经历史承载交接消息注入(缺席时 developer 消息兜底),保证 codex 截断历史后压缩内容仍可见。伪造交接是覆盖完整的(#4035):除活跃块摘要外,还携带上次折叠以来的近期工作(未压缩尾巴)——trigger 形态作为结构化条目放进伪造的 compaction blob(v2 信封,回显时展开),prompt 形态渲染进被采纳的摘要文本——本地伪造压缩不再把近期进展/草稿从模型视野中静默丢掉(codex 自身的保留机制只保留用户消息)。设为 `pass` 可退出,把 codex 的压缩请求转发给上游(原生压缩兜底)。任一安全门失败则原样透传。codex 客户端判定(本项生效范围,同时用于窗口 clamp 与会话身份指纹):User-Agent 须以已注册前缀开头(`codex_cli_rs/`、`codex_exec/`、`codex desktop/`——大小写不敏感,因 Codex Desktop 等变体首字母大写,#1169),或含某个以**小写** `codex` 开头的空白分隔组件(未知变体如 `codex_sdk_ts/…`,#645——#1641 起从裸子串收窄为 token 级前缀,UA 中仅在括号内/路径段提及 "codex" 的非 codex 客户端不再被误判;兜底有意保持大小写敏感,排除 "Codex"-形中继,#1106)。 |

---

Expand Down
Loading
Loading