Repository navigation
[PR] bili pi-inline: Enter the in-process engine with a single command (no proxy spawned, includes WS bridge) | bili pi-inline:一条命令进入 in-process 引擎(不起 proxy,含 WS 桥) - #4571
Merged
ranxianglei merged 3 commits intoOct 24, 2026
Conversation
…oxy, BILI_PI_INLINE) - launcher: pi-inline ClientName; refuses (exit 2) when the bili pi extension cannot load (no wire-mode fallback without a proxy), strips inherited BILLION_CONTEXT_PROXY/HTTPS_PROXY/BILI_MITM_HOSTS so planNativePi arms the in-process engine instead of attaching, sets BILI_PI_INLINE=1, same -e single-load rule as the proxy lane - cli help + examples - scripts/ci-pretest-cache.d.mts: declare refreshDistMtimes (runtime export existed; the declaration file lagged and typecheck flagged the test) - tests/launcher-pi-inline.test.ts: no-proxy/no-fetch assertions, env stripping under a hostile inherited proxy posture, -e only when settings has no entry, refusal path spawns nothing
… terminal
Field report on bili pi-inline: at boot every [storage]/[persist]/[inline]
line scrolled the pi input box away ('启动的时候都是日志 输入框没了').
The tee logger's stderr leg exists for the foreground proxy process; in the
inline lane (#3278) the engine runs INSIDE the host agent, so stderr is the
interactive TUI. Mute the terminal leg at engine start (bili.log file leg
stays; the logger re-enables stderr itself if the file leg dies, #2864);
BILI_INLINE_DEBUG=1 opts back in for live troubleshooting (documented in the
env-only seed). Regression test: real engine boot under a stderr spy must
write zero bytes.
Owner
Author
|
真机复现的一个更深的坑,已修(edf73af): |
ranxianglei
added a commit
that referenced
this pull request
Oct 24, 2026
… a loopback listener (#4571) Field report: the inline status panel printed a dead 'Web UI: http://127.0.0.1:0/...' link (no listener exists inline — the fake request sockets hardcode localPort 0) and nothing in the panel said the engine was the in-process inline lane. - startInlineEngine now binds a loopback-only, unref'd, admin-only web listener (127.0.0.1:<ephemeral>) that drives the same pipeline; the panel's Web UI deep link becomes a real browser-clickable URL. Model lanes (/bili/...) are deliberately NOT exposed on it; bind failure is fail-soft (link hidden). - the fake inline sockets report the real port as localPort so admin routes compute the true origin even for in-process status calls. - ProxyOptions.inlineLane marks the lane at boot; /__bili/plugin/status and /__bili/plugin/tool pass it through and the panel version line appends ' · inline'. - webSessionUrl hides ':0' origins instead of printing dead links.
ranxianglei
added a commit
that referenced
this pull request
Oct 24, 2026
…ver spawn unless opted back in (#4571) Plain `pi` with the plugin installed now compresses IN-PROCESS (inline lane, #3278): no proxy server process, no ephemeral port. The spawned-server mode is one opt-away: "pi": {"inline": false} in billion-context.json, or BILI_PI_INLINE=0/false/no/off in the env. Precedence is otherwise unchanged: kill switches and /bili/ launches still stand down; an explicit env/config inline choice still outranks everything; an announced attach target (launcher-set BILLION_CONTEXT_PROXY/ATTACH) still beats the new DEFAULT — wrapped launches keep attaching to their server. An explicit env OFF still suppresses a file-true value (env > file). planNativePi's fileInline parameter becomes tri-state (true/false/undefined) so 'not configured' (default inline) and 'explicitly disabled' (server) are distinct. Config reference seeds + CONFIGURATION.md regenerated.
ranxianglei
added a commit
that referenced
this pull request
Oct 25, 2026
#4571) Field report: a pi session opened from the inline panel showed 基本信息 with no hint of which engine served it, so "这个是 inline 模式吧?" could only be answered from bili.log (the session in question had in fact attached to a running server, not gone inline). Stamps session.metadata.engineLane at request time (handle.ts, first hit wins like clientHint): "inline" when the engine runs in-process (opts.inlineLane), "server" for a standalone proxy process (spawned or attached). The web session list chips it beside the client hint (inline / srv) and 基本信息 gains an 引擎 row — in-process (inline) vs server process. Pre-stamp sessions render nothing (absent = unknown, not guessed). Tests: pi-inline.test.ts inline-web case now asserts the pi session carries engineLane:"inline" in /__bili/sessions.
This was referenced Oct 25, 2026
ranxianglei
added a commit
that referenced
this pull request
Oct 25, 2026
Owner rule (never change defaults): plain with no signals plans the spawned proxy again, exactly as before #4669. Inline arms only on BILI_PI_INLINE=1/on/yes/TRUE or {"pi":{"inline":true}} (explicit choice still beats an announced attach target). Seeds/docs/LIFECYCLE updated; plan matrices re-flipped ({}→spawn pinned in pi-native + pi-inline-ws tests). Real-machine check: bare import plans spawn (spawn attempt observed), env-on/file-true plan inline.
antclt
pushed a commit
to antclt/billion-context
that referenced
this pull request
Oct 25, 2026
… a loopback listener (ranxianglei#4571) Field report: the inline status panel printed a dead 'Web UI: http://127.0.0.1:0/...' link (no listener exists inline — the fake request sockets hardcode localPort 0) and nothing in the panel said the engine was the in-process inline lane. - startInlineEngine now binds a loopback-only, unref'd, admin-only web listener (127.0.0.1:<ephemeral>) that drives the same pipeline; the panel's Web UI deep link becomes a real browser-clickable URL. Model lanes (/bili/...) are deliberately NOT exposed on it; bind failure is fail-soft (link hidden). - the fake inline sockets report the real port as localPort so admin routes compute the true origin even for in-process status calls. - ProxyOptions.inlineLane marks the lane at boot; /__bili/plugin/status and /__bili/plugin/tool pass it through and the panel version line appends ' · inline'. - webSessionUrl hides ':0' origins instead of printing dead links.
antclt
pushed a commit
to antclt/billion-context
that referenced
this pull request
Oct 25, 2026
…ver spawn unless opted back in (ranxianglei#4571) Plain `pi` with the plugin installed now compresses IN-PROCESS (inline lane, ranxianglei#3278): no proxy server process, no ephemeral port. The spawned-server mode is one opt-away: "pi": {"inline": false} in billion-context.json, or BILI_PI_INLINE=0/false/no/off in the env. Precedence is otherwise unchanged: kill switches and /bili/ launches still stand down; an explicit env/config inline choice still outranks everything; an announced attach target (launcher-set BILLION_CONTEXT_PROXY/ATTACH) still beats the new DEFAULT — wrapped launches keep attaching to their server. An explicit env OFF still suppresses a file-true value (env > file). planNativePi's fileInline parameter becomes tri-state (true/false/undefined) so 'not configured' (default inline) and 'explicitly disabled' (server) are distinct. Config reference seeds + CONFIGURATION.md regenerated.
antclt
pushed a commit
to antclt/billion-context
that referenced
this pull request
Oct 25, 2026
ranxianglei#4571) Field report: a pi session opened from the inline panel showed 基本信息 with no hint of which engine served it, so "这个是 inline 模式吧?" could only be answered from bili.log (the session in question had in fact attached to a running server, not gone inline). Stamps session.metadata.engineLane at request time (handle.ts, first hit wins like clientHint): "inline" when the engine runs in-process (opts.inlineLane), "server" for a standalone proxy process (spawned or attached). The web session list chips it beside the client hint (inline / srv) and 基本信息 gains an 引擎 row — in-process (inline) vs server process. Pre-stamp sessions render nothing (absent = unknown, not guessed). Tests: pi-inline.test.ts inline-web case now asserts the pi session carries engineLane:"inline" in /__bili/sessions.
This was referenced Oct 25, 2026
Merged
Louie0806
pushed a commit
to Louie0806/billion-context
that referenced
this pull request
Nov 4, 2026
planNativePi used to fall through to 'spawn' — bare pi with the extension installed spawned its own proxy (dist/index.js start, ephemeral port, parent-pid watchdog). Inline was opt-in only since ranxianglei#4687 reverted the ranxianglei#4571 flip. This restores the ranxianglei#4571 posture with explicit escape hatches: kill-switch > /bili/ launch > explicit inline (BILI_PI_INLINE=1/ on/yes/TRUE or "pi":{"inline":true}) > ANNOUNCED attach target (launcher-set BILLION_CONTEXT_PROXY/ATTACH — bili pi keeps its launcher proxy) > inline DEFAULT > spawn (explicit opt-out only) Opt-out restores the old attach/spawn posture verbatim: BILI_PI_INLINE=0/false/no/off or "pi":{"inline":false}. Blank BILI_PI_INLINE="" folds to unset. opencode's lane stays opt-in. bili pi-inline stays (NOT deprecated): it scrubs inherited BILLION_CONTEXT_PROXY/BILI_MITM_HOSTS so a stale attach env can't hijack the child, and preflights extension availability — with no proxy there is no wire-mode fallback, so a missing extension would otherwise silently run uncompressed. Supersedes the ranxianglei#4687 owner decision for the pi lane.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这是干嘛的
新命令
bili pi-inline:一条命令启动 pi,压缩跑在 pi 进程内(in-process 引擎),完全不起 proxy、不装 MITM 证书。之前想测 inline 只能手动BILI_PI_INLINE=on pi,而且如果 shell 里残留BILLION_CONTEXT_PROXY之类的变量,inline 会被静默顶掉、退回起 server——这正是 #4526 里"我测试不起作用"的另一个来源。改了什么
src/launcher.ts:新增pi-inline车道。启动前把继承来的BILLION_CONTEXT_PROXY/HTTPS_PROXY/BILI_MITM_HOSTS清掉(不清的话 planNativePi 会去 attach 而不是进 inline),给子进程设BILI_PI_INLINE=1,并按 proxy 车道同样的规则注入-e(settings.json 已装插件时不重复注入)。不起 proxy、不做任何健康探测。插件不可加载时直接拒绝(exit 2,不 spawn 任何东西)——没有 proxy 就没有 wire-mode 兜底,静默放行等于整场会话不压缩。src/cli.ts:帮助文本 + 示例。scripts/ci-pretest-cache.d.mts:补refreshDistMtimes声明(运行时导出已有,声明文件漏了,typecheck 会报错)。src/agent/dsh-native.ts:一处sidScope→dispatchScope(6d7c587 合并 [PR] merge: tier-1 consolidation train — 37 green PRs as one (conflicts resolved, #4294 reverted) #4525 时改名漏了这一处,本分支 typecheck 红;master 已在 de29698 修了同样内容,文本一致,合并时无冲突)。tests/launcher-pi-inline.test.ts(新):不起 proxy、零 fetch、恶意继承 proxy 环境下 env 清理、-e单次注入、拒绝路径不 spawn。测试
launcher-pi-inline2/2、launcher 回归面 395/395 全绿;typecheck 0 错误。bili pi-inline -- --version打出 "no proxy is started" 横幅,无 proxy 进程残留,退出码 0;外层故意设BILI_PI_INLINE=0也不影响(launcher 给子进程强制设 1)。关系
Closes nothing(入口便利性,#4526 的补充)