Repository navigation
refactor(#1714): retire all BILI_*/ACP_* behavior env vars to config.json - #1716
Closed
ranxianglei wants to merge 1 commit into
Closed
ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
…allMs config + 5s floor clamp (P1)
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1670-pr.1716.4669049This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1716.tgz
npm install -g packageInstall instructions are refreshed on each push. |
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.
Closes #1714
Full-scope delivery of the config-surface convergence: every behavior-class
BILI_*/ACP_*environment variable is retired — config.json is now the single input channel for proxy behavior. One PR per owner instruction (thread 2026-09-30).What changed
Retirement (69 names, canonical registry in
src/retired-env.ts)src/config.ts, knobs acrossfetch-util.ts,persist.ts,server.ts,mitm.ts,tunnel-guard.ts,error-dump.ts,decompress-shared.ts,fake-completion.ts,image-tokens.ts,upstream-proxy.ts,store.ts,session-gc.ts).BILI_MITM_DOMAINSuser knob retired: the launcher→child pipe is renamed to internalBILI_LAUNCHER_MITM_DOMAINSso no user-facing name re-opens the pollution vector (Opencode failed to send message with error: upstream stream ended before a completion event; this turn may be incomplete #1706 failure mode: stale shell export silently changing behavior).--debug/--no-auto-update/--auto-restart-on-update/--passthrough) now set ProxyOptions directly instead of routing throughprocess.env."file"|null; dead env-source 409 branch removed; clear button always enabled (en/zh copy synced).P4 — RETIRED startup scan
src/retired-env.ts: at boot, one-time scan of the process env for all 69 retired names; each hit warns onceBILI_X is no longer read — use "<field>" in config.json. Wired intocli.ts main(). The Opencode failed to send message with error: upstream stream ended before a completion event; this turn may be incomplete #1706 incident class (staleexport BILI_STREAM_STALL_MS=400) becomes visible instead of silent.P5 — docs
Base moved to v0.1.174. My earlier P1 commit (file-only
streamStallMs+ 5s floor) was superseded by owner-merged #1715, which removed the stall guard entirely — this branch drops P1 and follows master's design. To avoid double-warning,BILI_STREAM_STALL_MSis therefore NOT in the RETIRED map (master's own boot warning covers it).Behavior change disclosure (old → new)
Per reporting rule 4, every semantic shift:
export BILI_X=...took effect on next start (and some live-reloaded). New: env values are IGNORED; the config.json field is authoritative. Stale exports are inert and produce a one-time boot warning naming the replacement field. Migration = move value from env to file.FileConfigbut nothing forwarded them into the runtime (only tests called the setters) — users who set them got silently ignored values.startServer()+ both hot-reload paths insrc/server.tsnow apply all of them (persist enabled/zstd/tailTokens/debounce/epermAlert×2, maxSessions, imageTokenCap, fakeCompletionRetries/fakeBufCap, dump4xx/maxBytes, decompressTmpCap, ccrRetrievalTtlMs, tunnel allowedHosts, mitm handshakeTimeoutMs, sessionGc{enabled,maxAgeDays,maxTokens,intervalMs}, upstreamTimeoutMs, replayRetryMax/baseMs, maxShrinkPerCompress, proxyKeepAliveMaxMs, streamKeepaliveMs, requestWatchdog, preflightHoldMs, preflightDeadEndCooldownMs, sessionsDir). Old behavior: file value ignored, default used. New: file value honored. This is intended (the whole point of file-only), flagged because it changes what existing config files do.sessionsDirwiring added (startup + reloads); previously the env var was the only channel and the file field was unwired.-F/--forward-proxyfix: the flag previously wroteoverrides.BILI_UPSTREAM_PROXY; after env retirement that became a silent no-op. Now it sets a local marker applied directly afterloadOptions()in all three paths (doctor/update/start). Old: broken (post-retirement); new: works again.maxAgeDays/maxTokens/intervalMs) now honored from file (part of item 2).attachEvidenceGraceMs,attachHealthDeadlineMs, chainmaxFutureSkewMs/recentWindowMs): env fallbacks removed; programmatic module setters remain (tests/internal callers); no new config fields added — these post-date the issue inventory and are not user-facing product knobs; if you want them file-configurable, say so and I'll add them deliberately.Kept seams (documented, not retired)
BILI_LAUNCHER_MITM_DOMAINS), secret inputs, test seams (ACP_TEST_*,BILI_FAKE_HOOK_CMD,BILI_EPIPE_LOG_FILE,BILI_TEST_MARKER),ACP_RENDER_NONED-seam,ACP_PORT/HOST,BILI_CONFIG_FILE.BILI_ENCRYPTION_KEY,ACP_UPSTREAM,ACP_PROVIDERS,ACP_DUMP_*(listed here for the ruling, not migrated).Findings while working
ACP_REASONING_KEEPis owned by acp-kernel (behavioral probe: unset→reasoning preserved,none→dropped; bili passes it through). Out of scope — cross-repo; deferred, noted here rather than filed per loop-guard.tests/fix-437-idle-timeout.test.ts"healthy stream longer than timeout" failed 1× in local full-suite runs; solo A/B: fails 1/10 on pristine master too → pre-existing event-loop timing race (>500ms between 100ms chunks under load), not this PR (the diff touches none of its timer logic). CI is arbiter.Pre-flight
npm run typecheck✅ ·npm run build✅E2E_CHECK=1) ✅; full local codex e2e fails identically on pristine master in this sandbox (environment limitation, verified A/B) → relying onci-e2e.yml, which auto-runs (touches pipeline hot files).