Repository navigation
feat: omp three-mode alignment (proxy / launcher / native plugin) + runtime-info - #981
Conversation
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-981Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr981.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Picked up — this is a completed-work PR, so I'm verifying rather than redoing: fetching |
[bot] 🏷 Verification complete — this PR is solid and ready for a human merge. I reviewed rather than redid (completed-work PR from the #957 session). Branch & base
Local pre-flight on the head (re-ran everything)
Code review findings
Suggested order: merge whichever of #974/#979/#980 is furthest along first, then rebase #981 (trivial — its hunks are disjoint in intent; the 中文摘要:核验了 #957 的 omp 三模式对齐 PR(分支新、CI 全绿,本地重跑 typecheck/1930 测试/build 全过,产物冒烟确认原生标记同步生效);代码与 pi/dsh 既有模式一致、迁移语义完整,未发现需修复的问题——可以合并,但注意与 #974/#979/#980 存在热文件竞争(尤其 |
f017055 to
5071a29
Compare
Fixes #957
omp is an opencode fork on Bun that keeps the full pi extension API (config hooks / chat hooks / fetch patch / tool registration) — verified by live probe in the issue thread. This aligns omp with the #964 (pi) / #941 (dsh) three-mode playbook.
1. Native mode (
bili plugin install omp, no launcher)src/agent/omp-native.tsmirroringpi-native.ts: at load it spawns its own proxy (or attaches to a healthy running one, parent-pid watchdog), rewrites model traffic to<proxy>/bili/<upstream>via the global fetch intercept, registerscompress/decompress/acp_statusas native client tools (plugin mode), and gates the plugin-mode header on tool readiness (round 1 rides wire mode). SetsBILLION_CONTEXT_NATIVE=ompsynchronously at module evaluation so standalone extensions back off in-process. Opt-out:BILI_NATIVE_OMP=0.tsup.config.ts: new entry → self-containeddist/agent/omp-native.js(acp-kernel inlined). Thindist/agent/omp.jsstays for launcher mode.2. Installer migration (
src/plugin-install.ts)pluginInstall("omp")now targetsdist/agent/omp-native.js. Pre-[native] omp: three-mode alignment (proxy / launcher / native plugin) + runtime-info #957 thindist/agent/omp.jsentries are recognized by the shared entry regex and replaced on re-install — old installs upgrade to native mode, exactly one bili owner per config, output notes(replaced …). Remove / status / launcher loader-check accept both forms; stale paths still reportbroken.3. Runtime-info (#955 protocol,
src/agent/pi.ts)"omp"flavor ofcreateBiliPluginreports viaPOST /__bili/plugin/runtime-infofrombefore_provider_request— same shape as the other native hosts, deduped per model switch, soft-fail. Proxy-side window resolution unchanged (runtime-info table already exists).Tests: 12 new —
tests/omp-native.test.ts(bootstrap gate table incl. cross-host opt-out isolation, native-marker invariant, script-path resolution, installer fresh / idempotent / thin→native migration / dedupe / remove / status / launcher-eskip) and a real-HTTP fake-proxy end-to-end for the runtime-info flow intests/plugin-agent.test.ts(silence before tool readiness, dedupe, model switch). Two pre-existing tests updated for the intentional migration semantics (#392 sub-test a, fake-HOME roundtrip). 1930 pass / 0 fail; typecheck + build green on the rebased head (current master ba6c9ad).Docs: README en/zh — client table, Option-1 list, opt-out envs, runtime-info implementations list.
Not touched: wire protocol, config schema, persistence format, acp-kernel pin,
src/update.ts.