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
8 changes: 3 additions & 5 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Deploy website to GitHub Pages

on:
push:
branches: [master]
paths:
- "website/**"
- ".github/workflows/pages.yml"
# Push trigger suspended (#4598): the repo has no GitHub Pages site, so every
# website push red-lined the deploy job. Manual dispatch stays until the
# publishing direction is decided.
workflow_dispatch:

permissions:
Expand Down
4 changes: 2 additions & 2 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ This index is generated from `website/config-reference/*.yaml` — edit the seed
| `native.attachUrl` | string | unset (discover per lane) | BILI_MCP_PROXY | Explicit target origin for native-hook attach (any URL). When set, a hook attaches ONLY to that exact origin instead of auto-discovering, and spawns its own if it is not live; it must still be code-compatible and pass the lifecycle gate. The BILI_MCP_PROXY env var (also set by CLI --origin) takes precedence over this file value; empty/whitespace means unset. |
| `claude.nativePort` | number | unset (lane sticky zone port) | BILI_CLAUDE_NATIVE_PORT | Exact port pin for the claude native lane's hook-spawned proxy (strict-port: squatters are refused loudly). |
| `pi.subagents` | object \| boolean | {} (acp_delegate enabled with package defaults) | PI_ACP_DELEGATE_FORCE_ENABLE, PI_ACP_DELEGATE_MAX_DEPTH, PI_ACP_DELEGATE_SYNC_TIMEOUT_MINUTES, PI_ACP_DELEGATE_IDLE_TIMEOUT_MINUTES, PI_ACP_DELEGATE_ASYNC_TIMEOUT_MINUTES, PI_ACP_DELEGATE_MAX_CONCURRENT | Built-in pi-lane sub-agents (acp_delegate) surface, #2230 config-home. The pi.subagents section of billion-context.json owns the delegate config; the four acp.json keys (delegate/delegatePrompt/displayUsage/debug) are a deprecated fallback read only while the section is absent. prompt replaces delegatePrompt; debug is scoped to the sub-agent subsystem. Boolean shorthand subagents: false disables the whole surface. Full field table: the pi section in CONFIGURATION.md. |
| `pi.inline` | boolean | false | BILI_PI_INLINE | Pi inline lane (#3278): run the pi extension's compression IN-PROCESS — no spawned proxy, no ephemeral port; model traffic and the /__bili//__acp tool surface are served by an in-process engine through a pseudo-origin. Resolved env > file > default(off): BILI_PI_INLINE=1/true enables, BILI_PI_INLINE=0/false explicitly disables over this file value. |
| `pi.inline` | boolean | false | BILI_PI_INLINE | Pi inline lane (#3278): run the pi extension's compression IN-PROCESS — no spawned proxy; model traffic and the /__bili//__acp tool surface are served by an in-process engine through a pseudo-origin, and Codex Responses WebSocket traffic by a loopback-only upgrade bridge inside the engine (#4526; a bind failure degrades only that channel direct, warned). Resolved env > file > default(off): BILI_PI_INLINE accepts ANY non-empty value except 0/false/no/off as on (previously only 1/true — on/yes silently spawned); the four off-tokens explicitly disable over this file value. |

**MITM lane**

Expand Down Expand Up @@ -396,7 +396,7 @@ This index is generated from `website/config-reference/*.yaml` — edit the seed
| `BILI_NATIVE_OMP` | boolean-ish | off | — | Host posture: marks an omp-native plugin process. |
| `BILI_NATIVE_OPENCODE` | boolean-ish | off | — | Host posture: marks an opencode-native plugin process. |
| `BILI_NATIVE_PI` | boolean-ish | off | — | Host posture: marks a pi-native plugin process. |
| `BILI_PI_INLINE` | boolean-ish | off | — | Host posture: pi inline lane (#3278) — the pi extension compresses IN-PROCESS through the pseudo-origin instead of spawning its own proxy; outranks a preset BILLION_CONTEXT_PROXY attach target. |
| `BILI_PI_INLINE` | boolean-ish | off | — | Host posture: pi inline lane (#3278) — the pi extension compresses IN-PROCESS through the pseudo-origin instead of spawning its own proxy; outranks a preset BILLION_CONTEXT_PROXY attach target. Value table (#4526): any non-empty value except 0/false/no/off enables (previously only 1/true — on/yes silently fell back to spawn); the four off-tokens disable even over config-file pi.inline. |
| `BILI_NATIVE_ZCODE` | boolean-ish | off | — | Host posture: marks a zcode-native plugin process. |
| `BILI_PI_BIN` | string | pi (PATH lookup) | — | Host posture: explicit binary path for the pi client binary. |
| `BILI_DSH_BIN` | string | dsh (PATH lookup) | — | Host posture: explicit binary path for the dsh client binary. |
Expand Down
4 changes: 2 additions & 2 deletions CONFIGURATION.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
| `native.attachUrl` | string | unset (discover per lane) | BILI_MCP_PROXY | native hook 附着的显式目标源(任意 URL)。设置后,hook 只附着到该精确 origin 而不是自动发现,若其不在线则自行派生;仍需代码兼容并通过生命周期门禁。BILI_MCP_PROXY 环境变量(CLI --origin 亦会设置它)优先于此文件值;空/空白视为未设置。 |
| `claude.nativePort` | number | unset (lane sticky zone port) | BILI_CLAUDE_NATIVE_PORT | claude 原生车道钩子派生代理的精确端口钉死(严格端口:被占用时响亮拒绝而非跳端口)。 |
| `pi.subagents` | object \| boolean | {} (acp_delegate enabled with package defaults) | PI_ACP_DELEGATE_FORCE_ENABLE, PI_ACP_DELEGATE_MAX_DEPTH, PI_ACP_DELEGATE_SYNC_TIMEOUT_MINUTES, PI_ACP_DELEGATE_IDLE_TIMEOUT_MINUTES, PI_ACP_DELEGATE_ASYNC_TIMEOUT_MINUTES, PI_ACP_DELEGATE_MAX_CONCURRENT | 内置 pi lane 子代理(acp_delegate)面(#2230 配置搬家)。billion-context.json 的 pi.subagents 段拥有 delegate 配置;acp.json 四键(delegate/delegatePrompt/displayUsage/debug)为已废弃回退源,仅段缺失时读取。prompt 取代 delegatePrompt;debug 限定子代理子系统。布尔简写 subagents: false 整体关闭。完整字段表见 CONFIGURATION.md 的 pi 段。 |
| `pi.inline` | boolean | false | BILI_PI_INLINE | pi 内联压缩通道(#3278):pi 扩展在进程内直接压缩——不派生代理进程、无临时端口;模型流量与 /__bili//__acp 工具面由进程内引擎经伪源站服务。解析顺序 env > 文件 > 默认(off):BILI_PI_INLINE=1/true 开启,BILI_PI_INLINE=0/false 显式关闭且优先于本文件值。 |
| `pi.inline` | boolean | false | BILI_PI_INLINE | pi 内联压缩通道(#3278):pi 扩展在进程内直接压缩——不派生代理进程;模型流量与 /__bili//__acp 工具面由进程内引擎经伪源站服务,Codex Responses WebSocket 流量由引擎内的回环升级桥接服务(#4526;绑定失败仅该车道回退直连并告警)。解析顺序 env > 文件 > 默认(off):BILI_PI_INLINE 除 0/false/no/off 外任何非空值均视为开(此前仅认 1/true——on/yes 会静默回落到 spawn);四个关闭取值显式优先于本文件值。 |

**MITM 通道**

Expand Down Expand Up @@ -396,7 +396,7 @@
| `BILI_NATIVE_OMP` | boolean-ish | off | — | 宿主姿态:标记 omp 原生插件进程。 |
| `BILI_NATIVE_OPENCODE` | boolean-ish | off | — | 宿主姿态:标记 opencode 原生插件进程。 |
| `BILI_NATIVE_PI` | boolean-ish | off | — | 宿主姿态:标记 pi 原生插件进程。 |
| `BILI_PI_INLINE` | boolean-ish | off | — | 宿主姿态:pi 内联压缩通道(#3278)——pi 扩展在进程内通过伪源站直接压缩,不再另起代理进程;优先于预置的 BILLION_CONTEXT_PROXY 附着目标。 |
| `BILI_PI_INLINE` | boolean-ish | off | — | 宿主姿态:pi 内联压缩通道(#3278)——pi 扩展在进程内通过伪源站直接压缩,不再另起代理进程;优先于预置的 BILLION_CONTEXT_PROXY 附着目标。取值表(#4526):除 0/false/no/off 外任何非空值均开启(此前仅认 1/true——on/yes 会静默回落 spawn);四个关闭取值即使配置文件 pi.inline 为 true 也强制关闭。 |
| `BILI_NATIVE_ZCODE` | boolean-ish | off | — | 宿主姿态:标记 zcode 原生插件进程。 |
| `BILI_PI_BIN` | string | pi (PATH lookup) | — | 宿主姿态:pi 客户端二进制的显式路径。 |
| `BILI_DSH_BIN` | string | dsh (PATH lookup) | — | 宿主姿态:dsh 客户端二进制的显式路径。 |
Expand Down
2 changes: 1 addition & 1 deletion LIFECYCLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
| `BILI_ALLOW_DSH_COMPACTION` | dsh compaction | dsh compaction opt-in(env 语义同 BILI_PERSIST 家族) | 转正后移 §2 | opt-in(`=1`) |
| `BILI_SNAPSHOT_SHADOW` | #3756 | snapshot-render 影子观测:每个 armed turn 计算快照视图但**不使用**(出站仍走 legacy 路径),与实际发送对比记 per-session 计数(面板 + `snapshot-shadow` 诊断话题)——render 引擎在 rollout 翻转前用真实流量证明健康(dry-run-then-flip,同存储 #2815 shadow→#3818 full 纪律) | render 车道转正(rollout 100% 且影子计数归稳)后退役 | 默认 on(render lane 本身 rollout 0%,纯观测) |
| `BILI_DSH_AUTHORED_COMPACTION` | #3733 | dsh 原生 compaction summarize 调用由 #1729 guard 拒绝改为**本地应答折叠快照**(零出账;dsh 记 checkpoint、会话文件收缩) | adoption 后按 #2028 模式转 file/web 开关,env 退役(file 键 `dsh.authoredCompaction` 已镜像) | 0.1.203 dogfood 站稳后默认 on;`=0` 回 #1729 拒绝路径 |
| `BILI_PI_INLINE` | #3278 | pi inline 模式(默认 off):不起 proxy 进程,fetch 链在 intercept 之下的一个环节把伪 origin 流量路由进进程内引擎(inline-engine.ts,跑同 startServer 的每请求管线);file 家 `"pi": {"inline": true}`,`=0` 显式关 | inline 车道 GA(转 §2 常设)或实验放弃后收束 | opt-in(默认 off) |
| `BILI_PI_INLINE` | #3278/#4526 | pi inline 模式(默认 off):不起 proxy 进程,fetch 链在 intercept 之下的一个环节把伪 origin 流量路由进进程内引擎(inline-engine.ts,跑同 startServer 的每请求管线),Codex Responses WS 走引擎内的回环桥接(#4526,绑定失败仅该车道回退直连);file 家 `"pi": {"inline": true}`,`0/false/no/off` 显式关,其余非空值均开(#4526) | inline 车道 GA(转 §2 常设)或实验放弃后收束 | opt-in(默认 off) |
| 测试钩子:`BILI_DSH_RECOVERY_INTERVAL_MS` / `BILI_DSH_RETRY_INTERVAL_MS` / `BILI_MODEL_INFO_RETRY_MS` | #2082 等 | 缩短测试/运维节奏(dsh-native.ts;NODE_TEST_CONTEXT 感知,避免生产误缩) | 永久测试设施,随宿主代码走 | 测试钩子 |

## 2. 常设面全量登记表(src/ 实际读取的其余 BILI_* 环境变量)
Expand Down
3 changes: 3 additions & 0 deletions scripts/live-files.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export const LIVE_FILES = [
// #4434 (split-brain surface): spawns bili CLI children against a throwaway
// origin; own probe server is listen(0) so only the zone band matters
"tests/issue-split-brain-surface.test.ts",
// #3890: spawns the drain fixture; that fixture is listen(0) and reports
// READY <port>, so no zone band is needed — the entry is for the tripwire
"tests/issue3890-parent-gone-confirm-drain.test.ts",
];

/** Band width per live file: the zone ladder drifts +1 per EADDRINUSE retry;
Expand Down
2 changes: 1 addition & 1 deletion src/agent/client-build-note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import path from "node:path";
import { isVersionNewer } from "../update.js";
import { logHostEvent } from "./host-log.js";

export type ClientBuildCheck = {
type ClientBuildCheck = {
/** Short human label used in the note text ("dsh", "pi", ...). */
label: string;
/** The client's npm id, as shown in the note (@deepseek-ai/dsh, ...). */
Expand Down
15 changes: 15 additions & 0 deletions src/agent/native-intercept.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ export interface NativeInterceptState {
origin: string | undefined;
/** Resolves to the proxy origin once healthy, or undefined on failure. */
ready: Promise<string | undefined>;
/** #4526: inline-lane Codex Responses WebSocket target — the dialable
* loopback origin of the in-process engine's WS bridge
* ("http://127.0.0.1:<port>"). Written once the engine settles; stays
* undefined when the bridge bind failed (the channel degrades direct).
* Only set in inline mode — every other lane routes WS through
* state.origin exactly as before. */
wsOrigin?: string;
/** #4526: inline-lane Codex Responses WebSocket decision resolver — the
* WS wrapper awaits it instead of readyOrigin in inline mode (state.origin
* is frozen to the pseudo-origin that never listens, so readyOrigin would
* short-circuit to an undialable URL). Resolves to wsOrigin once the
* engine settles, or undefined when the bridge bind failed; a bootstrap
* rejection propagates and the wrapper degrades direct. Invoking it may
* trigger the memoized engine start. Absent on every non-inline lane. */
resolveInlineWs?: () => Promise<string | undefined>;
/** Owner hook: re-run the bootstrap (proxy died → respawn). */
respawn?: () => Promise<string | undefined>;
/** Owner hook: fired once when a respawn attempt fails and the session
Expand Down
36 changes: 36 additions & 0 deletions src/agent/native-ws-intercept.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,42 @@ export function installNativeWebSocketIntercept(initialState: NativeInterceptSta
state.onDispatch?.(rewritten, "rewrite");
return new RoutedWebSocket(rewritten, ...rest);
};
const resolveInlineWs = state.resolveInlineWs;
if (resolveInlineWs !== undefined) {
// #4526 inline lane: state.origin is the pseudo-origin that never
// listens — the only dialable endpoint is the engine's loopback WS
// bridge. Decision already made → route now; still booting → hold
// the shell until it settles (the engine start is memoized).
const settled = state.wsOrigin;
if (settled !== undefined) {
const rewritten = rewriteCodexResponsesWsUrl(target, settled);
// Deliberately NO noteRoutedOrigin here: the bridge is a
// same-process listener, not pinned-channel evidence —
// recording its loopback origin against the pseudo-origin
// would fire the #3923 split-brain alarm for nothing.
state.onDispatch?.(rewritten, "rewrite");
return new RoutedWebSocket(rewritten, ...rest);
}
return new DeferredWebSocket(
urlStr,
rest,
async () => {
const bridge = await resolveInlineWs().catch(() => undefined as string | undefined);
if (bridge === undefined) {
if (!warnedDirect) {
warnedDirect = true;
logHostEvent("warn", "[native-client]", `bili-native(ws): inline WebSocket bridge unavailable — Codex Responses WebSocket goes DIRECT (uncompressed): ${urlStr}`);
}
state.onDispatch?.(target, "direct");
return undefined;
}
const rewritten = rewriteCodexResponsesWsUrl(target, bridge);
state.onDispatch?.(rewritten, "rewrite");
return rewritten;
},
constructLive,
);
}
const origin = state.origin;
if (origin !== undefined) return rewrite(origin);
// Origin still settling → defer the real connection (bounded by
Expand Down
Loading
Loading