Repository navigation
Description
Summary
On the config page, the Recipe credentials panel renders for a recipe with a secret: ref, but Save Key cannot persist anything. The UI issues PUT /__bili/external-summary/credential, which the running proxy does not register; the router's generic admin-path fallback returns 404 {"error":{"type":"not_found","message":"no such management endpoint"}}. The credential store file is never created, so the chain keeps failing with credential secret:<masked> did not resolve to a value — it will be skipped until fixed.
Environment
Same as Issue 1: 0.1.197 / 3aeddc16, hermes-plugin, Windows 11, proxy on 127.0.0.1:18787.
Repro
- Configure a named recipe (e.g.
deepseek) withcredentialRef: "deepseek"so the panel appears. - Open
http://127.0.0.1:18787/__bili/#/config→ Recipe credentials → API Key → Save Key. - Error in the UI; the same request by hand returns:
PUT /__bili/external-summary/credential → 404 {"error":{"type":"not_found","message":"no such management endpoint"}} - Store file
<config>.summary-credentials.jsonis never created. - Chain log keeps repeating:
[external-summary] candidate deepseek--deepseek-chat unavailable: credential secret:<masked 8 chars> did not resolve to a value — it will be skipped until fixed
Evidence
- The UI served by the same proxy (
GET /__bili/) contains exactly this call:Labels:const result = await json("/__bili/external-summary/credential", { method: "PUT", headers: { "content-type": "application/json" }, body: JSON.stringify({ name: recipe.credentialRef, key: value }) });
summary.credentials= "Recipe credentials",summary.key= "API Key",summary.key_save= "Save Key",summary.key_missing= "Not configured". GET /__bili/exposes this admin path set —/__bili/config,/__bili/conflicts/clear,/__bili/host-plugins/dismiss,/__bili/overview,/__bili/resign,/__bili/sessions/,/__bili/upstream,/__bili/upstream/test— plus/__bili/external-summary/credential, which is the only one without a server route.dist/index.jsrouter fallback produces the observed body for any unregistered/__bili/*path:withif (isAdminPath) { res.writeHead(404, {"content-type":"application/json"}); res.end(JSON.stringify({error:{type:"not_found",message:"no such management endpoint"}})); return; }
isAdminPath = req.url === "/__bili/" || req.url.startsWith("/__bili/")— so the path is recognized as admin, it is simply not registered.- Grep of
dist/index.js:external-summaryappears only in chain parsing / summarising code (parseExternalSummaryChain,[external-summary] completed …, candidate construction,EXTERNAL_SUMMARY_CALL_ID_PREFIX), never in an HTTP route registration. - Ruled out: loopback and origin gates. Request came from
127.0.0.1with matchingOrigin/Refererheaders and still 404s (a genuine gate failure returns403with a distinct message).
Expected
Either register PUT /__bili/external-summary/credential (the shipped UI depends on it), or drop the button until the route exists.
Workaround that works (for anyone blocked today)
Write the store by hand — a flat { "<name>": "<key>" } JSON map at <config>.summary-credentials.json:
$path = "C:\Users\gsiva\.config\billion-context\billion-context.json.summary-credentials.json"
$json = '{"deepseek":"PASTE_YOUR_KEY"}'
[System.IO.File]::WriteAllText($path, $json, (New-Object System.Text.UTF8Encoding($false))) # no BOMNotes: SummaryCredentialStore.read() accepts exactly that shape (validKey forbids whitespace/control chars, ≤8192 bytes); the store is read at resolution time so no restart is needed; do not leave a ${path}.lock file behind (set() takes it with wx, so a stale lock makes writes fail with "External summary credential store is locked or unavailable").
Update (same install) — this bug is the only thing that was blocking external summary
With the store written by hand, the very next qualifying requests went from
[external-summary] completed (preflight) 1/1 range(s); batch=finished result=failed reason=exhausted attempts=[t0:error]
to
[external-summary] completed (preflight) 4/4 range(s); calls=4; batch=finished result=success attempts=[t0:success]
and auto-fold started landing blocks. So the missing route was the whole blocker.
Activity
ranxianglei commentedon Oct 16, 2026
(ai: vllm-qwen/qwen3.8-27b)
查重: 无 — open/closed issues 和 PR 里都没有同类报告(按 external-summary / credential / Save Key / 404 组合检索)。
结论:bug 属实,根因已钉死,正在修。
验证结果(在 master 和 0.1.197 上均成立):
handleSummaryCredentialPut一直存在(src/web/api.ts:141),校验、私有存储、删除语义都是完整的;Web UI 的 Save Key 按钮也一直存在(src/web/client.ts:2576)。/__bili/*管理路由现在集中在src/server/admin.ts的handleAdminRoute(audit: 全仓冗余审计与重构计划——server.ts 解体、客户端矩阵去重、死代码、AGENTS.md 模块图腐化 #1440 P2 cut 1 重构),里面没有/__bili/external-summary/credential这一条 → 落到兜底 404。你手写的 store 文件能立即生效,正是因为存储读取发生在 resolve 时、与路由无关——缺路由是唯一的阻塞点,和你观察到的完全一致。根因(git 取证):
bcf40118d(external summary 功能)当时把这条路由写在src/server.ts里;273c83945(admin 路由面抽到 admin.ts 的重构)把 server.ts 里的管理路由全部搬走;修复方案(进行中):
src/server/admin.ts注册该路由(继承与兄弟管理路径相同的 loopback + trusted-origin 门禁);行为变更声明:
PUT /__bili/external-summary/credential从「永远 404」变为可用端点(loopback + origin 门禁,与其他 /__bili 管理路径一致);无其他行为变化。PR 开好会在本线程更新链接。
ranxianglei commentedon Oct 16, 2026
(ai: vllm-qwen/qwen3.8-27b)
修复完成,PR: #3445 (Closes #3445 引用本 issue,等 CI + 人工合并)
八问:
PUT /__bili/external-summary/credential在路由器上从未注册,永远 404——external-summary 的密钥只能靠手写<config>.summary-credentials.json保存。bcf40118d)把路由写在src/server.ts;随后「admin 路由面抽到 admin.ts」的重构(273c83945,audit: 全仓冗余审计与重构计划——server.ts 解体、客户端矩阵去重、死代码、AGENTS.md 模块图腐化 #1440 P2 cut 1)把全部管理路由搬走;功能分支在重构之后合入(PR feat: 统一外部摘要模型、顺序故障转移与多客户端压缩接线 #2167),merge 解析时把这条新路由行静默丢掉(stale-base 语义冲突丢失)。处理器、UI、handler 级测试都幸存,只丢了路由接线;server.ts 还留着一行死 import,现有测试绕过真实路由器直接调 handler——所以 typecheck 和 CI 一直是绿的。secret:<name>凭据引用保存密钥的 external-summary 用户;程度 = 特定功能完全不可用(UI 保存路径断掉),无崩溃、无数据丢失,且你有已验证的手写文件 workaround。handleAdminRoute里注册这条路由(放在 config 路由旁、安全门禁之下——自动继承与其他 /__bili 管理路径相同的 loopback + trusted-origin 门禁);顺手清掉同一重构遗留的死 import(独立标注 commit);新增一个经过真实代理/路由器的回归测试(startServer + port 0:畸形 body→400、保存→200 且不回显 key、store 文件落盘、config GET 反映状态、key:null 删除)。红绿验证过:不带修复跑是 404 失败,带上全绿。行为变更声明:
PUT /__bili/external-summary/credential从「永远 404」变为可用端点(旧值→新值如上);安全姿态不变(loopback + origin 门禁与兄弟管理路径一致)。这是有意的修复目标,不是漂移。本地验证:typecheck 干净;定向套件 web-routing 9/9、external-summary-settings 43/43。全量回归以远程 CI 为准。判定:可合(等 CI 绿 + 人工合并)。合并后你重启 bili 即可直接在 UI 里 Save Key,不用再手写文件。
ranxianglei commentedon Oct 16, 2026
(ai: vllm-qwen/qwen3.8-27b)
更正上一条里的一处笔误:PR #3445 正文写的是
Closes #3443(即本 issue),不是 Closes #3445。其余内容不变。k-ying commentedon Nov 13, 2026
Still reproducible on 0.1.213 — the fix never shipped
Environment: bili
0.1.213(GET /__bili/health->{"version":"0.1.213","commit":"133f3525c","diskVersion":"0.1.213"}); npmlatestis also 0.1.213 at the time of writing.Repro (config page -> a recipe that uses
credentialRef-> paste key -> Save Key):stale: falseanddiskVersion === version, so this is not a stale process. In 0.1.213 the/__bilidispatcher has 42req.url === "..."comparisons and none of them isexternal-summary/credential, while the Web UI still ships thePUTcall. The handler is simply not registered on the server side.Why it never landed: the fix PR #3445 (+70/-2, 2 commits) was closed unmerged on 2026-10-24 during a stale-ticket cleanup ("目标 issue #3443 已关 ... 如判断有误请直接 reopen 并留言"). #3488 then recorded this sub-item as "already fixed by PR #3445", which is not the case. So the patch never reached npm.
Workaround until the route is registered: write the store by hand —
<config-file>.summary-credentials.json(e.g.~/.config/billion-context/billion-context.json.summary-credentials.json), content{"<credentialRef>":"<key>"}, mode0600, regular file, no symlink. It is re-read on each request, no restart needed. Note that Save Key is the only broken piece: credentials resolve fine once the chain is enabled, and/__bili/configkeepsexternalSummaryCredentialsempty whilecompress.externalSummary.enabledisfalse(targets are only expanded when enabled), so an empty list there does not mean the file was rejected.Would you consider reopening #3445, or re-registering the route? The change is self-contained: one
PUTbranch in the admin router that calls the existingSummaryCredentialStore.set().中文摘要
0.1.213 上
PUT /__bili/external-summary/credential仍然 404(no such management endpoint,stale:false,diskVersion与version同为 0.1.213),服务端 42 条路由里没有这一条,前端却仍在调用。原修复 PR #3445 于 2026-10-24 被当作陈旧票关闭(未合并),#3488 又把它记成「已由 #3445 修复」,于是补丁始终没进 npm。临时绕过:手写
<配置文件>.summary-credentials.json(内容{"<credentialRef>":"<key>"},0600,普通文件、非软链接),每次请求都会重新读取,无需重启。另注意enabled:false时/__bili/config的externalSummaryCredentials本来为空(不启用就不会展开 targets),不代表写入失败。能否重开 #3445 或重新注册该路由?改动很小,只需在 admin 路由加一个
PUT分支调用现有的SummaryCredentialStore.set()。