Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,6 @@ Environment variables take precedence over the config file. They are useful for
| `BILI_MODEL_INFO_RETRY_MS` | Cooldown (ms) before the dsh native plugin re-resolves the current model's context window after a resolve that failed or returned no window (#1812/#1836): a cached entry without a window is not final — instead of latching headerless for the process lifetime, the next request after this cooldown triggers a retry. Default `30000`; non-numeric or negative values fall back to `30000`. Test hook — shortened by the dsh-native unit test so it never waits wall-clock; leave unset in production. |
| `BILI_ADVISORY_CHECK` | Set to `0` to disable the critical-defect advisory watcher (#1481). Default ON — it runs independently of `ACP_AUTO_UPDATE` so that installs with auto-update off still get force-updated out of a known-broken version range. Fail-open: an unreachable/malformed source only warns, never blocks model traffic. File-config key: `advisoryCheck`. |
| `BILI_ADVISORY_URL` | Override for the advisory document URL. Default: the companion package `billion-context-advisories` on the configured registry (`BILI_UPDATE_REGISTRY` aware). File-config key: `advisoryUrl`. |
| `BILI_RELEASE_NOTES_CHECK` | Set to `0` to disable the tiered release-notes visibility watcher (#1870). Default ON — pure visibility: fetches the companion release-notes doc and surfaces "update ready — restart to finish" (disk newer than running) or "recommended update available" on `acp_status` and the `/acp` panel. Never installs, never restarts; fail-open. File-config key: `releaseNotesCheck`. |
| `BILI_RELEASE_NOTES_URL` | Override for the release-notes document URL. Default: the companion package `billion-context-release-notes` on the configured registry (`BILI_UPDATE_REGISTRY` aware). File-config key: `releaseNotesUrl`. |
| ~~`BILI_HOST_USAGE_CREDIT`~~ / ~~`hostUsageCredit`~~ | **Removed in #660.** Used to select the host-facing usage mode. The #408 uncompressed-baseline backfill is gone entirely — every host now reports the actually-forwarded (post-fold) request as provider-measured (matches `[acp-usage] input=`). Old values left in env or the config file are ignored; remove them. See the "Bug history lesson" section of PR #691. |
| `ACP_PROVIDERS` | Path to an external `providers.json` (legacy / shared file). |
| `BILI_REPLAY_RETRY_BASE_MS` | Base backoff delay (ms) for replay retries after a transient upstream rejection (default `1500`; set `0` to disable the delay). See #189. Also drives the main-path transport-retry backoff (#1688). |
Expand Down
2 changes: 0 additions & 2 deletions CONFIGURATION.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,6 @@
| `BILI_MODEL_INFO_RETRY_MS` | dsh 原生模型窗口解析失败(或解析结果不带窗口)后的重试冷却(毫秒,#1812/#1836):匹配的缓存条目没有 context window 时不视为最终结果 —— 不再让整个进程生命周期 latching 成无 header 状态,而是该冷却过期后由下一个请求触发重新解析。默认 `30000`;非数字或负值回退 `30000`。测试钩子 —— dsh-native 单元测试用它缩短冷却、避免真实等待;生产环境保持 unset。 |
| `BILI_ADVISORY_CHECK` | 设为 `0` 禁用严重缺陷公告监视器(#1481)。默认开启 —— 它独立于 `ACP_AUTO_UPDATE` 运行,确保关闭了自动更新的安装也能被强制移出已知缺陷版本范围。fail-open:公告源不可达/格式错误只告警,绝不阻断模型流量。文件配置键:`advisoryCheck`。 |
| `BILI_ADVISORY_URL` | 公告文档 URL 覆盖。默认:已配置 registry(感知 `BILI_UPDATE_REGISTRY`)上的伴生包 `billion-context-advisories`。文件配置键:`advisoryUrl`。 |
| `BILI_RELEASE_NOTES_CHECK` | 设为 `0` 禁用分级发版说明可见性监视器(#1870)。默认开启 —— 纯可见性:拉取伴生发版说明文档,并在 `acp_status` 与 `/acp` 面板提示「更新已就绪待重启」(磁盘版本新于运行版本)或「存在推荐更新」。绝不安装、绝不重启;fail-open。文件配置键:`releaseNotesCheck`。 |
| `BILI_RELEASE_NOTES_URL` | 发版说明文档 URL 覆盖。默认:已配置 registry(感知 `BILI_UPDATE_REGISTRY`)上的伴生包 `billion-context-release-notes`。文件配置键:`releaseNotesUrl`。 |
| ~~`BILI_HOST_USAGE_CREDIT`~~ / ~~`hostUsageCredit`~~ | **#660 已移除。** 曾用于选择宿主可见的用量模式。#408 的未折叠基线回补(backfill)已整体删除 —— 所有宿主现在统一上报“实际转发(后折叠)请求”的 provider 实测用量,与 `[acp-usage] input=` 一致。遗留该环境变量 / 配置键的旧值会被忽略,请删除。教训详见 PR #691 的 “Bug 历史教训” 一节。 |
| `ACP_PROVIDERS` | 指向外部 `providers.json` 的路径(旧版 / 共享文件)。 |
| `BILI_REPLAY_RETRY_BASE_MS` | 回放重试的基础退避延迟(毫秒):上游瞬时拒绝后重试(默认 `1500`;设 `0` 关闭延迟)。见 #189。同时驱动主路径传输重试的退避(#1688)。 |
Expand Down
12 changes: 7 additions & 5 deletions release-notes/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# billion-context-release-notes (companion payload, #1870)

Tiered, model-written release notes consumed by the proxy's visibility
watcher (`src/update-notes.ts`): acp_status and the `/acp` panel use them to
tell users and agents "an update is ready — restart to finish" or "a
recommended release exists", with a per-release summary and the user-side
span (everything between the running version and the newest release).
Tiered, model-written release notes. Since #1977 the proxy-side visibility
watcher is gone — updates are silent by default and only critical
advisories (`advisories/`, #1481) auto-surface — so this doc is now a
release-process artifact: the dispatch-time release gate (release-manual.yml /
release.yml, #1870) requires an entry for every stable release, and the tier +
summary record what each release changed for the user. The companion package
publish stays as the machine-readable carrier for any future consumer.

Companion package mechanics mirror `advisories/` (#1481):

Expand Down
24 changes: 0 additions & 24 deletions src/acp-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { ccrEnabled, ccrLoopConfig, contentStoreOf } from "./store.js";
import { coveredRefSpan } from "./decompress-shared.js";
import { preCompactionArchiveOf, type Session } from "./session.js";
import { describeAdvisory, getAdvisoryState } from "./advisory.js";
import { getUpdateVisibility } from "./update-notes.js";
import { VERSION } from "./version.js";

export interface AcpStatusCtx {
Expand Down Expand Up @@ -148,29 +147,6 @@ export function handleAcpStatus(args: Record<string, unknown>, ctx: AcpStatusCtx
extra.push("");
extra.push(`CRITICAL ADVISORY (instance-level): bili is auto-updating through the self-updater's safety chain — ${describeAdvisory(adv.active, adv.lastError)}. Live state: GET /__bili/status → advisory.`);
}
const upd = getUpdateVisibility(VERSION);
if (upd.visible) {
// #1870: the self-updater is a silent courier on native lanes — the
// "Restart to finish" log line never reaches pi/opencode/dsh users,
// so disk runs new while the process runs old. This is the surface
// agents actually poll: tell them a restart is actionable NOW, or
// that a recommended release exists when auto-update is off.
extra.push("");
const lines: string[] = [];
if (upd.pendingRestart) {
lines.push(`UPDATE READY (instance-level): ${upd.diskVersion} downloaded — restart this agent's proxy to finish (running ${upd.runningVersion}).`);
} else {
lines.push(`UPDATE AVAILABLE (instance-level): newer recommended release on the channel — running ${upd.runningVersion}.`);
}
for (const e of upd.span) {
lines.push(` · ${e.version} [${e.tier}] ${e.summary}`);
}
if (!upd.pendingRestart) {
lines.push(` Update with: npm install -g billion-context@${upd.span[upd.span.length - 1]?.version ?? "latest"}`);
}
lines.push("Live state: GET /__bili/status → update.");
extra.push(...lines);
}
const blind = getBlindTunnelStats();
if (blind.total > 0) {
// #897: CONNECT traffic to non-MITM hosts was blind-relayed — it never
Expand Down
15 changes: 2 additions & 13 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { log as loggerLog } from "./logger.js";
import { createAutoRestartHandler } from "./restart.js";
import { checkForUpdate, startAutoUpdate } from "./update.js";
import { startAdvisoryWatcher, getAdvisoryState, advisoryDeferring, advisoryBlocksVersion } from "./advisory.js";
import { startReleaseNotesWatcher } from "./update-notes.js";
import { resolveProxy } from "./upstream-proxy.js";
import { runMcpStdio } from "./mcp.js";
import { PLUGIN_AGENTS, isPluginAgent, pluginInstall, pluginRemove, pluginStatusAll, pluginUpdate, type PluginAgent } from "./plugin-install.js";
Expand Down Expand Up @@ -631,16 +630,6 @@ export async function main(): Promise<void> {
}),
});
}
// #1870: tiered release-notes visibility — fetch + cache only (never
// installs, never restarts). Runs independently of autoUpdate for the
// same reason as the advisory watcher: installs with auto-update off
// still deserve to learn a recommended update exists.
if (opts.releaseNotesCheck) {
startReleaseNotesWatcher({
packageName: PACKAGE_NAME,
currentVersion: VERSION,
releaseNotesUrl: opts.releaseNotesUrl,
resolveProxy: (url) => resolveProxy(opts.routes, opts.proxy, url, opts.proxyFallback),
});
}
// #1977: the release-notes visibility watcher is gone — updates are
// silent by default; only critical advisories (#1481) auto-surface.
}
16 changes: 0 additions & 16 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,14 +664,8 @@ export type ProxyOptions = {
* autoUpdate and force-installs the owner-recommended version when the
* local version falls inside an affected range. Default ON. */
advisoryCheck: boolean;
/** Tiered release-notes visibility (#1870): fetch + cache only — never
* installs, never restarts. Default ON. */
releaseNotesCheck: boolean;
/** Override for the advisory document URL (env BILI_ADVISORY_URL wins). */
advisoryUrl?: string;
/** Override for the release-notes document URL (env
* BILI_RELEASE_NOTES_URL wins) (#1870). */
releaseNotesUrl?: string;
logFile?: string;
/** MITM transparent-proxy mode. When enabled, an HTTP CONNECT handler is
* attached so clients that only know how to set HTTP_PROXY (ZCode with a
Expand Down Expand Up @@ -1112,11 +1106,7 @@ export function loadOptions(env: NodeJS.ProcessEnv = process.env): ProxyOptions
// Default ON: unlike autoRestartOnUpdate, this never touches process
// liveness — it only installs files and warns (#1481).
advisoryCheck: (env.BILI_ADVISORY_CHECK ?? (fileConfig.advisoryCheck === false ? "0" : "1")) !== "0",
// Default ON: same reasoning as advisoryCheck — pure visibility (fetch
// + cache; never installs, never restarts) (#1870).
releaseNotesCheck: (env.BILI_RELEASE_NOTES_CHECK ?? (fileConfig.releaseNotesCheck === false ? "0" : "1")) !== "0",
advisoryUrl: env.BILI_ADVISORY_URL || fileConfig.advisoryUrl || undefined,
releaseNotesUrl: env.BILI_RELEASE_NOTES_URL || fileConfig.releaseNotesUrl || undefined,
logFile: env.ACP_LOG_FILE !== undefined ? (env.ACP_LOG_FILE || undefined) : fileConfig.logFile,
mitm: {
enabled: (env.BILI_MITM ?? (fileConfig.mitm?.enabled === false ? "0" : "1")) !== "0",
Expand Down Expand Up @@ -1198,14 +1188,8 @@ type FileConfig = {
/** Set `false` to disable the critical-defect advisory watcher (#1481);
* env BILI_ADVISORY_CHECK wins when set. */
advisoryCheck?: boolean;
/** Set `false` to disable the tiered release-notes visibility watcher
* (#1870); env BILI_RELEASE_NOTES_CHECK wins when set. */
releaseNotesCheck?: boolean;
/** Override for the advisory document URL (env BILI_ADVISORY_URL wins). */
advisoryUrl?: string;
/** Override for the release-notes document URL (env
* BILI_RELEASE_NOTES_URL wins) (#1870). */
releaseNotesUrl?: string;
upstreamProxy?: string;
upstreamProxyMode?: string;
logFile?: string;
Expand Down
10 changes: 2 additions & 8 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { emitStreamError, emitUpstreamTruncation } from "./stream-error.js";
import { degenerateTurnWarning } from "./degenerate-turn.js";
import { PANEL_BOX_FOOTER } from "./acp-panel.js";
import { describeAdvisory, getAdvisoryState } from "./advisory.js";
import { describeUpdateReady, getUpdateVisibility } from "./update-notes.js";
import { warnCacheCollapse } from "./cache-warn.js";
import { settleUsageReport } from "./cache-ledger.js";
import { promptInputTotal, type WireProtocol } from "./util.js";
Expand Down Expand Up @@ -866,13 +865,8 @@ export function handlePluginStatus(conversationId: string, res: import("node:htt
if (adv.active) {
preFooter.push(`⚠️ CRITICAL ADVISORY: ${describeAdvisory(adv.active, adv.lastError)}`);
}
const upd = getUpdateVisibility(VERSION);
if (upd.visible) {
// #1870: visibility for the silent courier — one line, same
// before-footer slot as the advisory (remote-doc text; the $-escape
// below already covers it).
preFooter.push(describeUpdateReady(upd));
}
// #1977: release-notes visibility is silent by default — the advisory
// above is the only auto-visible update channel left here.
const webUrl = webSessionUrl(deps.webOrigin, session.id);
if (webUrl !== undefined) {
preFooter.push(`Web UI: ${webUrl}`);
Expand Down
Loading
Loading