diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 804a26d13b..20d392be1c 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -393,6 +393,7 @@ This index is generated from `website/config-reference/*.yaml` — edit the seed | `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. Truthy = any non-empty value except 0/false/no/off (on/yes/TRUE all enable; a miss used to silently fall back to spawning a proxy). Codex Responses WS traffic is routed through a loopback-only bridge booted with the engine; if that bridge fails, the WS lane degrades DIRECT (warned) while HTTP compression stays in-process. | +| `BILI_INLINE_DEBUG` | boolean-ish | off | — | Inline lane (#3278) only: keep the engine's log lines on stderr after muting them (the inline engine runs inside the pi process, where stderr is the interactive TUI — every [persist]/[storage]/[inline] line would scroll the input box away; default keeps them in bili.log only). | | `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. | diff --git a/CONFIGURATION.zh-CN.md b/CONFIGURATION.zh-CN.md index f90bb00ba1..ddc3a9976e 100644 --- a/CONFIGURATION.zh-CN.md +++ b/CONFIGURATION.zh-CN.md @@ -393,6 +393,7 @@ | `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 附着目标。除 0/false/no/off 外任何非空值均算开启(on/yes/TRUE 均可;旧版不认这些写法会静默回退成另起代理)。codex 的 Responses WS 流量改走随引擎启动的仅回环桥;桥起不来时该通道退回直连(打 warn),HTTP 压缩仍留在进程内。 | +| `BILI_INLINE_DEBUG` | boolean-ish | off | — | 仅内联通道(#3278):把引擎日志保留在 stderr 上(默认关闭——内联引擎跑在 pi 进程里,stderr 就是交互终端,每行 [persist]/[storage]/[inline] 都会把输入框挤掉;默认只写 bili.log)。 | | `BILI_NATIVE_ZCODE` | boolean-ish | off | — | 宿主姿态:标记 zcode 原生插件进程。 | | `BILI_PI_BIN` | string | pi (PATH lookup) | — | 宿主姿态:pi 客户端二进制的显式路径。 | | `BILI_DSH_BIN` | string | dsh (PATH lookup) | — | 宿主姿态:dsh 客户端二进制的显式路径。 | diff --git a/scripts/ci-pretest-cache.d.mts b/scripts/ci-pretest-cache.d.mts index 83e96ded50..e49fa052d6 100644 --- a/scripts/ci-pretest-cache.d.mts +++ b/scripts/ci-pretest-cache.d.mts @@ -14,6 +14,7 @@ export const MARKER_NAME: string; export const COMPONENTS: PretestCacheComponent[]; export function hashComponent(root: string, comp: PretestCacheComponent, platform?: string): string; export function markerIsFresh(distDir: string, hash: string): boolean; +export function refreshDistMtimes(distDir: string, now?: Date): number; export function runPretestCache(opts?: { root?: string; components?: PretestCacheComponent[]; diff --git a/src/agent/dsh-native.ts b/src/agent/dsh-native.ts index 59c9b253e0..59e8e76bab 100644 --- a/src/agent/dsh-native.ts +++ b/src/agent/dsh-native.ts @@ -1284,8 +1284,10 @@ 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; + // #4491 generalized the scope to LlmDispatchScope (dispatchScope); + // scoped attribution is active when that store carries a sid. + const scopedStore = dispatchScope.getStore(); + const scopedActive = scopedStore !== undefined && typeof scopedStore.sid === "string" && scopedStore.sid.length > 0; const shape = verdict.reason === "initiator-threw" ? `threw (${verdict.detail ?? "unknown"})` : verdict.reason === "initiator-missing" ? "returned no agent" diff --git a/src/cli.ts b/src/cli.ts index e8f0ed8cfc..1a1ce550dc 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -51,6 +51,7 @@ Usage: bili [start] [options] start the proxy (default: reads ${defaultConfigFile()}) bili pi [opts --] [args] start a proxy + launch pi against it (cert-MITM) bili pi-test [opts --] [args] like bili pi but injects --no-extensions (clean test) + bili pi-inline [opts --] [args] launch pi on the in-process engine — no proxy at all (BILI_PI_INLINE) bili codex [opts --] [args] start a proxy + launch codex against it (cert-MITM) bili claude [opts --] [args] start a proxy + launch claude against it (cert-MITM) bili omp [opts --] [args] start a proxy + launch omp against it (cert-MITM) @@ -132,6 +133,7 @@ Launcher (bili pi / bili codex / bili claude / bili omp / bili opencode / bili h bili pi # launch pi through the proxy bili pi -- print "hi" # args after the client are passed through bili pi-test # pi through the proxy with extensions off (proxy owns compression) + bili pi-inline # pi with the in-process engine — no proxy, no MITM certs bili codex # launch codex through the proxy bili claude # launch claude through the proxy bili omp # launch omp through the proxy (pi-based; /bili/ rewrite) diff --git a/src/inline-engine.ts b/src/inline-engine.ts index 5a184a9bdf..e2159ddcc3 100644 --- a/src/inline-engine.ts +++ b/src/inline-engine.ts @@ -19,7 +19,7 @@ import { createEngineContext, type EngineContext } from "./server.js"; import { handle } from "./server/handle.js"; import { withFetchTransport } from "./fetch-transport.js"; import type { FetchOptions } from "./fetch-util.js"; -import { log as loggerLog } from "./logger.js"; +import { log as loggerLog, muteStderrLeg } from "./logger.js"; /** Pseudo-origin of the inline lane. Never DNS-resolved: any request reaching * this host is served in-process by installInlineTransport before egress. */ @@ -359,6 +359,16 @@ export function _resetInlineEngineForTest(): void { } async function startInlineEngine(): Promise { + // The engine runs INSIDE the host agent's process (#3278 inline lane), + // and that process's stderr IS the interactive TUI terminal (pi, dsh, + // …). The tee logger's stderr leg would print every engine line — + // storage mode, persist warm-up, the background index scan 1-2 s after + // boot — straight onto the TUI, scrolling the input box away (field + // report: "启动的时候都是日志 输入框没了"). Keep the durable bili.log file + // leg, mute the terminal leg; the logger re-enables stderr itself if the + // file leg ever dies (#2864), and BILI_INLINE_DEBUG=1 opts back in for + // live troubleshooting. + if (!process.env.BILI_INLINE_DEBUG) muteStderrLeg(); // Same pre-flight as the CLI server path (cli.ts `start`): template // config, resolved options, sqlite engine self-bootstrap (#2833). ensureConfigTemplate(); diff --git a/src/launcher.ts b/src/launcher.ts index 38bb18a9bd..a968cccde4 100644 --- a/src/launcher.ts +++ b/src/launcher.ts @@ -163,7 +163,7 @@ import { conflictRemediation } from "./conflict-watch.js"; import { conflictScanEnabled, isDesignBenign, scanClientPlugins } from "./thirdparty-scan.js"; export const LAUNCHER_DEFAULT_HOST = "127.0.0.1"; -export const LAUNCH_CLIENTS = ["pi", "codex", "claude", "omp", "opencode", "hermes", "dsh", "codebuddy", "qoder", "trae", "jcode", "kimi", "gemini", "iflow", "qwen", "mcode", "aider", "copilot", "amp", "crush", "zed", "goose", "antigravity", "pi-test"] as const; +export const LAUNCH_CLIENTS = ["pi", "codex", "claude", "omp", "opencode", "hermes", "dsh", "codebuddy", "qoder", "trae", "jcode", "kimi", "gemini", "iflow", "qwen", "mcode", "aider", "copilot", "amp", "crush", "zed", "goose", "antigravity", "pi-test", "pi-inline"] as const; export type ClientName = (typeof LAUNCH_CLIENTS)[number]; type BaseClientName = "claude" | "codex" | "pi" | "omp" | "opencode" | "hermes" | "dsh" | "codebuddy" | "qoder" | "trae" | "jcode" | "kimi" | "gemini" | "iflow" | "qwen" | "mcode" | "aider" | "copilot" | "amp" | "crush" | "zed" | "goose" | "antigravity"; @@ -333,7 +333,7 @@ export function isLaunchClient(value: string): value is ClientName { } export function baseClientName(client: ClientName): BaseClientName { - return client === "pi-test" ? "pi" : client; + return client === "pi-test" || client === "pi-inline" ? "pi" : client; } /** `pi-test` injects `--no-extensions` so the billion-context-pi client extension doesn't double-compress alongside the proxy. */ @@ -5763,6 +5763,52 @@ export async function runLaunch(params: RunLaunchParams, deps: LauncherDeps = {} ); } } + // `bili pi-inline` (#3278/#4526): launch pi on the IN-PROCESS engine — no + // proxy is spawned at all. BILI_PI_INLINE outranks ambient attach envs in + // planNativePi, so the child's own bili extension arms inline mode and + // (with the loopback WS bridge) also takes the codex WebSocket lane. The + // extension MUST be loadable here: with no proxy there is no wire-mode + // fallback, so a missing extension would silently run uncompressed. + if (params.client === "pi-inline") { + const piExt = selfDistFile("agent/pi.js"); + const extAvailable = (piExt !== undefined && fs.existsSync(piExt)) || piPluginInstalled(piRealHome); + if (!extAvailable) { + console.error( + "bili: pi-inline needs the bili pi extension — run `bili plugin install pi` or reinstall billion-context " + + "(dist/agent/pi.js missing and the plugin is not installed in " + piRealHome + "/settings.json)", + ); + process.exit(2); + return; + } + // Clean slate for the child: a stale inherited BILLION_CONTEXT_PROXY + // would make planNativePi ATTACH instead of arming the in-process + // engine, and inherited proxy/MITM env has nothing to do inline (no + // TLS is terminated in this lane). + const inlineEnv = stripInheritedProxy(process.env); + delete inlineEnv.BILLION_CONTEXT_PROXY; + delete inlineEnv.BILI_MITM_HOSTS; + inlineEnv.BILI_PI_INLINE = "1"; + let inlineArgs = params.clientArgs; + // Same single-load rule as the proxy lane: when settings.json already + // loads the plugin, `-e` on top would double-register it. + if (piExt && fs.existsSync(piExt) && !piPluginInstalled(piRealHome)) { + inlineArgs = ["-e", piExt, ...inlineArgs]; + } + console.error("bili: pi-inline — compression runs inside pi (in-process engine + loopback WS bridge); no proxy is started."); + const { command, prefixArgs } = resolveClientCommand("pi", process.env, deps.platform ?? process.platform); + let inlineCode = 0; + try { + inlineCode = await runClient(command, [...prefixArgs, ...inlineArgs], inlineEnv, { + spawnImpl: deps.spawnImpl, + platform: deps.platform, + }); + } catch (err) { + console.error(`bili: failed to launch pi-inline: ${err instanceof Error ? err.message : String(err)}`); + inlineCode = 1; + } + process.exit(inlineCode ?? 0); + return; + } if (base === "omp" && routes.httpRewrites.length > 0) { const ompExt = selfDistFile("agent/omp.js"); const extAvailable = (ompExt !== undefined && fs.existsSync(ompExt)) || ompPluginLoadedFrom(ompRealHome); diff --git a/tests/launcher-pi-inline.test.ts b/tests/launcher-pi-inline.test.ts new file mode 100644 index 0000000000..23470a3598 --- /dev/null +++ b/tests/launcher-pi-inline.test.ts @@ -0,0 +1,212 @@ +import { test } from "node:test"; +import assert from "node:assert/strict"; +import fs from "node:fs"; +import os from "node:os"; +import path from "node:path"; +import { rmrf } from "./tmp-rm.ts"; +import { runLaunch } from "../src/launcher.js"; +import type { SpawnChild, SpawnFn } from "../src/launcher.js"; +import { selfPackageRoot } from "../src/plugin-install.js"; + +function makeFakeChild(pid: number): SpawnChild { + const handlers = new Map void)[]>(); + return { + pid, + unref() {}, + kill() { + return true; + }, + on(event, listener) { + const list = handlers.get(event) ?? []; + list.push(listener); + handlers.set(event, list); + }, + }; +} + +interface SpawnRecord { + command: string; + args: string[]; + env: NodeJS.ProcessEnv | undefined; +} + +// `bili pi-inline` (#3278/#4526): the launcher must start NO proxy, hand the +// child a clean env with BILI_PI_INLINE=1 (no BILLION_CONTEXT_PROXY/HTTPS_PROXY +// — planNativePi would otherwise attach instead of arming the in-process +// engine), and follow the same single-load rule as the proxy lane for `-e`. +test("runLaunch pi-inline: no proxy spawned, BILI_PI_INLINE=1, attach/proxy env stripped, -e only when plugin not installed", async () => { + const home = fs.mkdtempSync(path.join(os.tmpdir(), "bili-piinline-")); + const prevHome = process.env.HOME; + const prevUserProfile = process.env.USERPROFILE; + const prevPiBin = process.env.PI_BIN; + const prevPiDir = process.env.PI_CODING_AGENT_DIR; + const prevBcp = process.env.BILLION_CONTEXT_PROXY; + const prevHttpsProxy = process.env.HTTPS_PROXY; + const prevMitmHosts = process.env.BILI_MITM_HOSTS; + process.env.HOME = home; + if (prevUserProfile !== undefined) process.env.USERPROFILE = home; + delete process.env.PI_CODING_AGENT_DIR; + // Hostile inherited posture: these would flip planNativePi to attach (or + // MITM-shape routing) if the launcher failed to strip them. + process.env.BILLION_CONTEXT_PROXY = "http://127.0.0.1:9"; + process.env.HTTPS_PROXY = "http://127.0.0.1:9"; + process.env.BILI_MITM_HOSTS = "example.com"; + const fakePi = path.join(home, process.platform === "win32" ? "fake-pi.exe" : "fake-pi"); + fs.writeFileSync(fakePi, ""); + process.env.PI_BIN = fakePi; + const piHome = path.join(home, ".pi/agent"); + fs.mkdirSync(piHome, { recursive: true }); + fs.writeFileSync(path.join(piHome, "models.json"), JSON.stringify({ providers: {} })); + + // runLaunch only injects -e when dist/agent/pi.js exists; create a stub + // when running tests from a checkout without a prior build (same seam as + // tests/launcher.test.ts). + const root = selfPackageRoot(); + const distAgent = path.join(root, "dist", "agent", "pi.js"); + const stubbed = !fs.existsSync(distAgent); + if (stubbed) { + fs.mkdirSync(path.dirname(distAgent), { recursive: true }); + fs.writeFileSync(distAgent, ""); + } + + const spawns: SpawnRecord[] = []; + const spawnImpl: SpawnFn = (cmd, args, options) => { + spawns.push({ command: cmd, args: [...args], env: options?.env }); + const child = makeFakeChild(0); + const orig = child.on!.bind(child); + (child as { on: SpawnChild["on"] }).on = (event, listener) => { + orig(event, listener); + if (event === "exit") setTimeout(() => listener(0, null), 0); + return child; + }; + return child; + }; + // No proxy is started on this lane — any health probe or fetch is a bug. + const fetched: string[] = []; + const fetchImpl = async (url: string) => { + fetched.push(String(url)); + return { ok: true }; + }; + const fetchHealthInfo = async (origin: string) => { + fetched.push(`health:${origin}`); + return { ok: true, pid: 42422 }; + }; + + const prevExit = process.exit; + const exitCalls: number[] = []; + process.exit = ((code?: number) => { + exitCalls.push(code ?? 0); + return undefined as never; + }) as typeof process.exit; + + try { + await runLaunch( + { client: "pi-inline", clientArgs: [], overrides: {} }, + { fetchImpl, fetchHealthInfo, spawnImpl, sleep: () => Promise.resolve() }, + ); + assert.equal(spawns.length, 1, "exactly one child (pi itself) — no proxy spawn"); + assert.equal(spawns[0].command, fakePi); + assert.deepEqual(spawns[0].args.slice(0, 2), ["-e", distAgent], "plugin injected via -e when settings.json has no entry"); + const env = spawns[0].env!; + assert.equal(env.BILI_PI_INLINE, "1"); + assert.equal(env.BILLION_CONTEXT_PROXY, undefined, "inherited BILLION_CONTEXT_PROXY must be stripped (attach would win)"); + assert.equal(env.HTTPS_PROXY, undefined, "inherited HTTPS_PROXY must be stripped (no MITM lane)"); + assert.equal(env.BILI_MITM_HOSTS, undefined); + assert.deepEqual(fetched, [], "no proxy health/fetch traffic on the inline lane"); + assert.deepEqual(exitCalls, [0]); + + // settings.json packages already points at this install → no -e + fs.writeFileSync(path.join(piHome, "settings.json"), JSON.stringify({ packages: [root] })); + spawns.length = 0; + exitCalls.length = 0; + await runLaunch( + { client: "pi-inline", clientArgs: [], overrides: {} }, + { fetchImpl, fetchHealthInfo, spawnImpl, sleep: () => Promise.resolve() }, + ); + assert.equal(spawns.length, 1); + assert.ok(!spawns[0].args.includes("-e"), "no double-register when settings.json already loads the plugin"); + assert.equal(spawns[0].env!.BILI_PI_INLINE, "1"); + assert.deepEqual(exitCalls, [0]); + } finally { + process.exit = prevExit; + process.env.HOME = prevHome; + if (prevUserProfile === undefined) delete process.env.USERPROFILE; + else process.env.USERPROFILE = prevUserProfile; + if (prevPiBin === undefined) delete process.env.PI_BIN; + else process.env.PI_BIN = prevPiBin; + if (prevPiDir === undefined) delete process.env.PI_CODING_AGENT_DIR; + else process.env.PI_CODING_AGENT_DIR = prevPiDir; + if (prevBcp === undefined) delete process.env.BILLION_CONTEXT_PROXY; + else process.env.BILLION_CONTEXT_PROXY = prevBcp; + if (prevHttpsProxy === undefined) delete process.env.HTTPS_PROXY; + else process.env.HTTPS_PROXY = prevHttpsProxy; + if (prevMitmHosts === undefined) delete process.env.BILI_MITM_HOSTS; + else process.env.BILI_MITM_HOSTS = prevMitmHosts; + if (stubbed) fs.rmSync(distAgent, { force: true }); + rmrf(home); + } +}); + +// Without a loadable extension the inline lane must refuse BEFORE spawning +// anything: there is no wire-mode fallback when no proxy exists, so a silent +// pass-through would run the whole session uncompressed. +test("runLaunch pi-inline: refuses (exit 2) when the bili extension cannot load", async () => { + const home = fs.mkdtempSync(path.join(os.tmpdir(), "bili-piinlineref-")); + const prevHome = process.env.HOME; + const prevUserProfile = process.env.USERPROFILE; + const prevPiBin = process.env.PI_BIN; + const prevPiDir = process.env.PI_CODING_AGENT_DIR; + process.env.HOME = home; + if (prevUserProfile !== undefined) process.env.USERPROFILE = home; + delete process.env.PI_CODING_AGENT_DIR; + const fakePi = path.join(home, process.platform === "win32" ? "fake-pi.exe" : "fake-pi"); + fs.writeFileSync(fakePi, ""); + process.env.PI_BIN = fakePi; + const piHome = path.join(home, ".pi/agent"); + fs.mkdirSync(piHome, { recursive: true }); + fs.writeFileSync(path.join(piHome, "models.json"), JSON.stringify({ providers: {} })); + + const root = selfPackageRoot(); + const distAgent = path.join(root, "dist", "agent", "pi.js"); + const distBackup = `${distAgent}.bak-test`; + const distExisted = fs.existsSync(distAgent); + if (distExisted) fs.renameSync(distAgent, distBackup); + else { + // A stub that exists would make the launch succeed — ensure absence. + fs.rmSync(distAgent, { force: true }); + } + + const spawns: SpawnRecord[] = []; + const spawnImpl: SpawnFn = (cmd, args, options) => { + spawns.push({ command: cmd, args: [...args], env: options?.env }); + return makeFakeChild(42422); + }; + + const prevExit = process.exit; + const exitCalls: number[] = []; + process.exit = ((code?: number) => { + exitCalls.push(code ?? 0); + return undefined as never; + }) as typeof process.exit; + + try { + await runLaunch( + { client: "pi-inline", clientArgs: [], overrides: {} }, + { spawnImpl, sleep: () => Promise.resolve() }, + ); + assert.equal(exitCalls.length, 1); + assert.equal(exitCalls[0], 2, "must refuse with exit code 2"); + assert.equal(spawns.length, 0, "nothing may be spawned — not even pi"); + } finally { + process.exit = prevExit; + process.env.HOME = prevHome; + if (prevUserProfile === undefined) delete process.env.USERPROFILE; + else process.env.USERPROFILE = prevUserProfile; + if (prevPiBin === undefined) delete process.env.PI_BIN; + else process.env.PI_BIN = prevPiBin; + if (prevPiDir === undefined) delete process.env.PI_CODING_AGENT_DIR; + else process.env.PI_CODING_AGENT_DIR = prevPiDir; + if (distExisted) fs.renameSync(distBackup, distAgent); + rmrf(home); + } +}); diff --git a/tests/pi-inline.test.ts b/tests/pi-inline.test.ts index 3ebd8d3007..5406ac2a6c 100644 --- a/tests/pi-inline.test.ts +++ b/tests/pi-inline.test.ts @@ -209,6 +209,31 @@ test("#3278 engine: real pipeline runs in-process — one upstream round trip, s assert.equal(h.status, 200); }); +test("#3278 engine: boot is TUI-safe — zero stderr writes while the interactive host owns the terminal", { timeout: 90_000 }, async () => { + // Field report (2026-10-24): `bili pi-inline` scrolled the pi input box + // away — the inline engine runs INSIDE the host process, so the tee + // logger's stderr leg printed every [storage]/[persist]/[inline] line + // straight onto the interactive terminal. The engine must mute that leg + // (file-only; BILI_INLINE_DEBUG opts back in) at boot. + const ie = await import("../src/inline-engine.ts"); + ie._setEngineFactoryForTest(undefined); + ie._resetInlineEngineForTest(); + const realWrite = process.stderr.write.bind(process.stderr); + const seen: string[] = []; + process.stderr.write = ((chunk: unknown, ...rest: unknown[]) => { + seen.push(typeof chunk === "string" ? chunk : String(chunk)); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (realWrite as any)(chunk, ...rest); + }) as typeof process.stderr.write; + try { + const engine = await withTimeout(ie.getInlineEngine(), 60_000, "engine boot"); + assert.equal(engine.origin, ie.INLINE_ORIGIN); + assert.equal(seen.length, 0, `inline boot must not write to the host's TUI stderr, got: ${seen.join(" | ").slice(0, 400)}`); + } finally { + process.stderr.write = realWrite; + } +}); + test("#3278 engine: caller abort cancels the in-process round trip (spawn-mode parity)", { timeout: 60_000 }, async () => { const ie = await import("../src/inline-engine.ts"); const engine = await withTimeout(ie.getInlineEngine(), 60_000, "engine boot"); diff --git a/website/config-reference/env-only.yaml b/website/config-reference/env-only.yaml index 30c5aa2553..79aec7290e 100644 --- a/website/config-reference/env-only.yaml +++ b/website/config-reference/env-only.yaml @@ -354,6 +354,14 @@ entries: group: envonly desc_en: "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. Truthy = any non-empty value except 0/false/no/off (on/yes/TRUE all enable; a miss used to silently fall back to spawning a proxy). Codex Responses WS traffic is routed through a loopback-only bridge booted with the engine; if that bridge fails, the WS lane degrades DIRECT (warned) while HTTP compression stays in-process." desc_zh: "宿主姿态:pi 内联压缩通道(#3278)——pi 扩展在进程内通过伪源站直接压缩,不再另起代理进程;优先于预置的 BILLION_CONTEXT_PROXY 附着目标。除 0/false/no/off 外任何非空值均算开启(on/yes/TRUE 均可;旧版不认这些写法会静默回退成另起代理)。codex 的 Responses WS 流量改走随引擎启动的仅回环桥;桥起不来时该通道退回直连(打 warn),HTTP 压缩仍留在进程内。" + - key: BILI_INLINE_DEBUG + type: boolean-ish + default: "off" + kind: env-only + audience: internal + group: envonly + desc_en: "Inline lane (#3278) only: keep the engine's log lines on stderr after muting them (the inline engine runs inside the pi process, where stderr is the interactive TUI — every [persist]/[storage]/[inline] line would scroll the input box away; default keeps them in bili.log only)." + desc_zh: "仅内联通道(#3278):把引擎日志保留在 stderr 上(默认关闭——内联引擎跑在 pi 进程里,stderr 就是交互终端,每行 [persist]/[storage]/[inline] 都会把输入框挤掉;默认只写 bili.log)。" - key: BILI_NATIVE_ZCODE type: boolean-ish default: "off"