Repository navigation
[PR] feat: BILI_PLUGIN_BYPASS operator override for the x-bili-plugin-bypass passthrough (#6220) - #6360
Open
ranxianglei wants to merge 3 commits into
Open
[PR] feat: BILI_PLUGIN_BYPASS operator override for the x-bili-plugin-bypass passthrough (#6220)#6360ranxianglei wants to merge 3 commits into
ranxianglei wants to merge 3 commits into
Conversation
…ss passthrough (#6220) Add an env-only three-state operator override for the inbound `x-bili-plugin-bypass` passthrough decision, read per-request (no restart) at the single decision point in src/server/handle.ts: - unset / auto (default): current behavior — the inbound header decides per request (legacy opencode-acp sessions bypass, everything else gets the full pipeline). Byte-identical to before when unset. - 1 / on / true: force bypass — every inbound request is forwarded verbatim (no tool injection, no nudge, no session binding). - 0 / off / false: never bypass — any inbound `x-bili-plugin-bypass` header is ignored, so even legacy opencode-acp sessions get the full pipeline. Env-only on owner sign-off in #6222 (the header is a wire contract stamped by hosts; the override is a per-process operator posture, not a per-route config field). Documented in docs/configuration.md en+zh (generated env-only table + narrative table) and the config-reference seed. Fixes #6220
Contributor
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9297-pr.6360.82c4899This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6360.tgz
npm install -g packageInstall instructions are refreshed on each push. |
added 2 commits
November 12, 2026 15:45
The lifecycle-ledger-guard requires every BILI_* env var read from src/ to be registered in docs/lifecycle.md. BILI_PLUGIN_BYPASS (added in the preceding commit) is a permanent operator knob with no release condition → §2.6 安全 / 运维通道.
check-unused-exports flags PluginBypassOverride as INTERNAL_ONLY — the type is only used as the return annotation of pluginBypassOverride() in the same file; handle.ts imports the function, not the type. Drop the `export`.
This branch has not been deployed
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.
Summary
Adds an env-only, three-state operator override for the inbound
x-bili-plugin-bypasspassthrough decision. The decision currently lives at a single point (src/server/handle.ts): if the inbound headerx-bili-plugin-bypass: 1is present, the request is forwarded verbatim (no tool injection, no nudge, no session binding) — a legacy contract stamped by the opencode host for in-process compression sessions (#920). Operators had no way to force or forbid that bypass; this adds the knob.Behavior (three-state, read per-request, no restart)
BILI_PLUGIN_BYPASSauto(default)1/on/true0/off/falsex-bili-plugin-bypassheader is ignored, so even legacy opencode-acp sessions get the full pipeline.The single decision point becomes:
bypass = override=="on" || (override=="auto" && header=="1"). The log line reports which path fired (forced vs legacy header).Config surface
BILI_PLUGIN_BYPASS— env-only, no config-file twin, no CLI flag.x-bili-plugin-bypassheader is a per-request, host-stamped wire signal (binary, host-controlled). There is no operator-side knob to override it; the three-state (force-on / force-off / auto) cannot be expressed by the header alone.providerstable (not applicable — this is a per-request routing decision, not provider selection); thecompresshierarchy (not applicable — bypass skips the whole pipeline, not compression tuning); the rollout/feature-flag system (considered — a plain env var was chosen per owner sign-off in [Bug][storage] Verification digests ignore own __proto__ fields in retained JSON content #6222 because this is a stable per-process operator posture, not a gradual rollout).docs/configuration.md+.zh-CN.md(generated env-only table + narrative table) and thewebsite/config-reference/env-only.yamlseed.Verification
npm run typecheck— cleannpm run build— successnode --import tsx --test tests/plugin-bypass.test.ts— 6/6 pass (2 existing opencode v1: keep opencode-acp legacy sessions working after switching to bili #920 header tests + 4 new override tests, incl. the key force-off-overrides-header case)node scripts/config-surface-guard.mjs— coverage OKnode tools/gen-config-docs.mjs check-coverage— 204 env names + 63 keys documentedBoth compression modes
The change is in the inbound routing decision, before mode binding: bypass (either path) forwards verbatim, so neither plugin nor proxy mode is entered. When not bypassed, the existing per-request mode decision is untouched. No wire/message-shape change; no kernel change.
Fixes #6220