Skip to content

[PR] feat: #3714 surface direct-through-unrecognized-endpoint traffic in acp_status + panel - #3718

Open
ranxianglei wants to merge 3 commits into
masterfrom
2026-10-18_unrouted-endpoint-visibility
Open

ranxianglei wants to merge 3 commits into
masterfrom
2026-10-18_unrouted-endpoint-visibility

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Part of #3714 — delivers the transition-period visibility stopgap (ask #3 of that issue). Actual compression for these endpoints (asks #1/#2) still rides on #1295 / PR #1444 + byte-level captures, so this PR does NOT close #3714.

What & why

Custom-wire model endpoints (e.g. TRAE llm_utils_chat, Qoder sash agent_chat_generation from the our-free-model plugin channel) are sent DIRECT at the host — the dsh fetch gate (isModelApiUrl) does not recognize them, so they never reach the proxy. That makes the existing server-side unrecognizedPaths stat (#1290/#1291) blind to exactly this case: it only counts requests that arrived at a proxy path. Today such a user discovers the zero-compression only by reading logs; acp_status just says "unknown plugin conversation".

This PR propagates the host-side knowledge to the proxy and surfaces it where users already look:

Behavior changes (disclosed per policy)

  • acp_status/compress unknown-conversation error text: old = fixed generic multi-candidate message; new = same message plus an appended NOTE naming the reported endpoints, and ONLY when the instance has received ≥1 unrouted report. Unchanged otherwise.
  • /__bili/status & /__bili/overview payloads: additive unrouted field (empty object until first report); no existing field altered.
  • Web panel: new banner element; no existing banner altered.
  • No compression behavior, threshold, default, data-format, or session-binding change. Pure diagnostics; both compression modes unaffected.

Config surface

None — no new config/env; the eventual fix is the existing modelEndpointPatterns from #1295 (not introduced here).

Tests

tests/issue3714-unrouted-endpoints.test.ts (new): storage latest-wins/union, ingest validation + input bounding, and both directions of the 404 note (unchanged when nothing reported; names them when reported). Targeted suites green locally on the rebased head (typecheck + build + issue3714/dsh-native/plugin-protocol/plugin-status-provenance); full-suite verdict is CI.

Related: #1295 · PR #1444 · #2975 · #1290 · #1291


Fixes #3714

(孤儿认领:标题本已指向 #3714,补上关闭关键字 —— 第三批清理)

@ranxianglei ranxianglei changed the title feat: #3714 surface direct-through-unrecognized-endpoint traffic in acp_status + panel [PR] feat: #3714 surface direct-through-unrecognized-endpoint traffic in acp_status + panel Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-18_unrouted-endpoint-visibility (fc656d3)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4833-pr.3718.8ea929a

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr3718.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重:不重复。 本 PR 是 #3714 诉求 #3(过渡期可见性止血)的交付物,与相邻条目机制或范围均不同:

标签: dsh · scope/ui · p3(dsh fetch gate 触发的可见性缺口,诊断面改进,纯增量无行为破坏)。

正在按 review 规范独立核对本分支(方向关 #3714 / 回归清点 / 代码 / 测试有效性 / diff 整洁度)并等 CI 结果,结论随后以八问体例回复。

ranxianglei pushed a commit that referenced this pull request Oct 18, 2026
…ntax break (#3718 review)

WEB_CLIENT is a plain-JS template string that tsc/tsup never parse, so the
'const flat: string[]' added with the unrouted banner compiled locally yet
threw 'Missing initializer in const declaration' in every browser, killing
the entire panel IIFE (caught by the web-i18n new-Function pin, red on this
head vs green on master).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

审核完成。结论先行:方向正确、实现干净,但审核中发现 1 处真实回归——已直接在本分支修掉并补了行为钉(共追加 2 个 commit,已推送)。等新 head CI 全绿即可合并。

发现的回归(原 head 不能直接合的原因)

  • src/web/client.ts 新 banner 代码里写了 const flat: string[] = [];——TS 类型标注。但 WEB_CLIENT 是面向浏览器的 JS 模板字符串,tsc/tsup 根本不解析其内容,所以本地 typecheck/build 全绿;真实浏览器里整个面板 IIFE 编译失败(Missing initializer in const declaration),整个 web UI 挂掉,不只是 banner 不显示。
  • 证据:tests/web-i18n.test.ts(内含 new Function(WEB_CLIENT) 语法钉)在 master 10/10 全过,在本 PR 原 head 3/10 挂。
  • 修复:f17992869(删标注)。这类问题只有"真编译客户端"的测试能抓——正是为此补了下面那层钉。

补充的测试钉(35cfc8d):PR 原测试只直调 handlePluginUnrouted,真正经 HTTP 出货的面没被钉住。按 upstream-alerts 同款模式加了真 server + 真客户端(vm 里执行 WEB_CLIENT):status/overview 的 additive unrouted 字段(首报前为空、两表 parity)、路由对坏 JSON/缺 agent 返回 400、banner 有报告时点名两个端点、干净时保持隐藏。

八问逐项:

  1. 是什么问题:TRAE/Qoder 这类自定义 wire 端点被宿主 fetch 门直接 DIRECT 发走、从不经过代理,零压缩且零可见性;acp_status 只会说 "unknown plugin conversation"。本 PR 把这个状态显式暴露给用户(宿主上报 → 代理存储 → 404 报错点名 + 面板 banner)。它只做 [Feature] Zero compression for the two custom-wire endpoints on the our-free-model plugin channel in dsh (qoder CN agent | [Feature] dsh 内 our-free-model 插件渠道的两个 custom-wire 端点零压缩(qoder CN agent_chat_generation / TRAE llm_utils_chat)——请纳入 #1295 modelEndp… #3714 的 ask Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3(过渡期可见性),不含真正的压缩支持([Feature] Declarable custom-wire model endpoints — route providers like commandcode's Go plan (/alpha/generate) into compression #1295/[PR] feat: declarable custom-wire model endpoints + commandcode-cli wire family (#1295) #1444 + byte capture),所以不关 [Feature] Zero compression for the two custom-wire endpoints on the our-free-model plugin channel in dsh (qoder CN agent | [Feature] dsh 内 our-free-model 插件渠道的两个 custom-wire 端点零压缩(qoder CN agent_chat_generation / TRAE llm_utils_chat)——请纳入 #1295 modelEndp… #3714——定位准确。
  2. 什么原因导致的:宿主侧知识(哪些端点走了 unrouted)没有回传通道;服务端 unrecognizedPaths 统计(dsh使用插件dsh-commandcode-provider反代go套餐的话,不进billion-context压缩 #1290/fix: surface unrouted / unrecognized-path requests instead of going silent (#1290) #1291)只能数"到达过代理"的请求,对这个场景恰好盲。
  3. 影响范围与严重程度:纯诊断面,压缩行为零改动。用户可见变化仅两处:有上报时 unknown-conversation 404 文案追加 NOTE;面板新增一个 banner。严重度低(p3)。
  4. 怎么修复的:宿主对每个 distinct 端点首次 sighting 时 fire-and-forget POST /__bili/plugin/unrouted 一次(健康/已路由流量永不触碰);代理按 agent latest-wins 存内存,输入有界(单路径 ≤512 字符、计数 ≤256);status/overview 共用同一 wire helper([web] advisory banner 是死代码:/__bili/overview 不含 advisory 字段,web 客户端从不调用 /__bili/status #2152 parity 教训);banner 刻意不gate 在 live===0 上——其他通道可能正在正常压缩,而这些端点仍在直连。
  5. 是否有回归问题:既有行为逐项审过——无报告时 404 错误文本与旧版逐字节相同(双向都有测试钉);status/overview 纯 additive 字段、未动任何既有字段;page/banner/i18n 全部新增、既有 banner 未动;阈值/默认值/wire/会话绑定零变化,两种压缩模式均不受影响。唯一回归即上述 TS 标注(整面板级破坏),已修。一个已知限制(非回归):存储为内存态,代理重启后宿主不会重报"已知的"端点(只在出现新端点或宿主重启后重报)——作为可见性止血可接受,真正的修复仍落在 modelEndpointPatterns。
  6. 是否破坏缓存:不涉及(纯诊断,不触碰缓存/重试/游标/去重键)。
  7. 是否改了设计方向:没有转向。完全沿用 压缩接管失效后完全静默:面板与 /__bili/status 看不出压缩已停,用户全价直连直到重启才恢复 #3581 attribution-health 通道的既有模式(事件驱动的宿主→proxy 上报),与现有架构一致。
  8. 是否引入了新的配置:无(不加 config/env;最终修复用的 [Feature] Declarable custom-wire model endpoints — route providers like commandcode's Go plan (/alpha/generate) into compression #1295 既有 modelEndpointPatterns,本 PR 不引入)。

判定:上述 2 个 commit 之后,新 head CI 全绿即可合并(本地定向套件全绿:issue3714 10/10、web-i18n 10/10、web-storage-banner 5/5、dsh-native 60/60、plugin-status-provenance 8/8、issue3581-attribution-health 1/1,typecheck 干净;全量以 CI 为准)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

进度更新(接上一条审核结论):

CI 状态:审核追加的 2 个 commit(f179928 修复 + 35cfc8d 测试钉)推送后,前几轮 CI 里有一个 Windows test 分片红了。已查明与本 PR 改动无关,是 runner 环境问题:

  • 失败签名:某测试(#3436 … spawn path)spawn 的子进程代理 60 秒内没起来(子进程日志 0 字节、端口一直没人绑定)→ harness 按设计 kill → node:test 把该文件后续 40 个测试全部 cancelledByParent 级联取消。零断言失败。
  • 本地证据:该文件(dsh-native attach 家族)在本 head 上 60/60 全绿;同签名涉及的 lane-decisions-matrix 单独跑 58/58 全绿;本 PR diff 只碰 src/web/client.ts 一行 + 测试文件,不触碰任何 spawn/attach/launcher 路径。
  • 背景:同一 head 在短时间内被触发了多轮完整 CI(并发分片挤同一批 runner),Windows 子进程起不来是典型的资源争抢表现。

现在新一轮 CI(触发于 15:00Z)正在跑,我盯着,出结果再报。若该 Windows 分片再次以同样签名红,就属于持续环境问题而非本 PR,届时会在 PR 上标注请人工 re-run。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

CI 进展更新(接上两条):

已对上一轮红的 run 执行 rerun-failed-jobs(只重跑 3 个红分片:test ubuntu-22-1、test ubuntu-24-1、test windows-22-2,同一 head 35cfc8d,无新 push)。目前除这 3 个分片在跑之外,其余全部 job 已绿(含之前一度红过的 config-surface-guard、unused-exports)。

关于 Ubuntu 分片里唯一断言失败的测试,拿到了直接证据:两个 Ubuntu runner 上挂的都是同一个 tests/port-zone-live.test.ts 的 zone live: unmarked lane'd spawn against a LIVE same-build twin exits instead of hopping (#3044)。我在本 head 上开 ACP_TEST_CLAUDE_NATIVE=1(该文件是 live-proxy e2e,默认跳过)本地定向跑了整个文件:9/9 全绿,包括这条。且这两个 runner 的 job 日志里有明确的 ENOSPC: no space left on device(runner 磁盘写满)+ ECONNREFUSED 噪音——14:09Z 的触发风暴让多轮完整 CI 挤在同一批 runner 上,磁盘/进程资源耗尽,spawn 出的子进程行为异常导致断言漂移。结论:与本 PR diff(web/client.ts 一行 + 一个测试文件)无关。

等这 3 个重跑分片出结果,全绿即给出最终收工判定。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

进度更新(接上一条审核结论):

CI 状态:审核追加的 2 个 commit(f179928 修复 + 35cfc8d 测试钉)推送后,前几轮 CI 里有一个 Windows test 分片红了。已查明与本 PR 改动无关,是 runner 环境问题:

  • 失败签名:某测试(#3436 … spawn path)spawn 的子进程代理 60 秒内没起来(子进程日志 0 字节、端口一直没人绑定)→ harness 按设计 kill → node:test 把该文件后续 40 个测试全部 cancelledByParent 级联取消。零断言失败。
  • 本地证据:该文件(dsh-native attach 家族)在本 head 上 60/60 全绿;同签名涉及的 lane-decisions-matrix 单独跑 58/58 全绿;本 PR diff 只碰 src/web/client.ts 一行 + 测试文件,不触碰任何 spawn/attach/launcher 路径。
  • 背景:同一 head 在短时间内被触发了多轮完整 CI(并发分片挤同一批 runner),Windows 子进程起不来是典型的资源争抢表现。

现在新一轮 CI(触发于 15:00Z)正在跑,我盯着,出结果再报。若该 Windows 分片再次以同样签名红,就属于持续环境问题而非本 PR,届时会在 PR 上标注请人工 re-run。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

更正上一条措辞(避免误导):当前不是在等「新一轮完整 CI」,而是对上一轮红掉的 run(同一 head 35cfc8d)执行的 rerun-failed-jobs——只重跑 3 个红分片(test ubuntu-22-1、ubuntu-24-1、windows-22-2)。截至刚才其余全部 job 已绿。这 3 个分片仍在跑(全量 test 分片通常 15-25 分钟),出结果我立即报最终判定。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

最终审核判定(结构化八问)。head = 35cfc8d(原 commit + 审核追加的 f179928 修复、35cfc8d13 测试钉)。

  1. 是什么问题:本 PR 为 [Feature] Zero compression for the two custom-wire endpoints on the our-free-model plugin channel in dsh (qoder CN agent | [Feature] dsh 内 our-free-model 插件渠道的两个 custom-wire 端点零压缩(qoder CN agent_chat_generation / TRAE llm_utils_chat)——请纳入 #1295 modelEndp… #3714 的 ask#3 提供过渡期可见性止血——自定义 wire 端点(TRAE/Qoder sash)直连 host 绕开代理时,让 acp_status/面板能点名这些端点。审核发现 PR 自身引入一个真实回归:浏览器 JS 模板串里混进 TypeScript 类型标注,导致整个 Web 面板 JS 无法编译。已修复并加测试钉住。
  2. 什么原因导致的:WEB_CLIENT(src/web/client.ts)是纯浏览器 JS 的模板字符串,tsc/tsup 从不解析其内容;原代码在 :750 写了 const flat: string[] = []——真实浏览器解析即抛 Missing initializer in const declaration,整个面板 IIFE 死掉。作者本地门禁(typecheck/build/单测)全部碰不到模板串内容,所以漏网。
  3. 影响范围与严重程度:若按原样合入,所有打开 Web 面板的用户拿到的是完全失效的面板(全部 JS 不执行)——合并前属 p1 级破坏;现已修复,当前影响为零。
  4. 怎么修复的:去掉标注(const flat = []);并补了恰好能抓住这类 bug 的两层测试:①真实 HTTP 下 /__bili/status 与 /__bili/overview 的 unrouted 字段 wire 平价(空报告→{},有报告→逐 agent 排序列表);②在 vm 沙箱里执行真实的 WEB_CLIENT,断言 banner 有报告时显示且点名端点、无报告时隐藏清空(仿 upstream-alerts.test.ts 的 harness)。
  5. 是否有回归问题:既有行为逐项清点——acp_status/compress 未知会话 404 文案:双向钉死(无报告时字节不变、有报告时追加 NOTE);其余 4 处同文案位置刻意不动;status/overview 纯增量字段;既有 banner 未动;无配置/阈值/wire/会话绑定变更;两种压缩模式均不受影响。CI 红分片全部查明为环境问题,非本 PR 回归(见下)。
  6. 是否破坏缓存:不涉及(纯内存诊断 Map,不触碰任何缓存/重试/游标/去重键)。
  7. 是否改了设计方向:不涉及——完全镜像既有 压缩接管失效后完全静默:面板与 /__bili/status 看不出压缩已停,用户全价直连直到重启才恢复 #3581 attribution-health 通道模式。
  8. 是否引入新配置:无。

CI 取证结论(head 35cfc8d,run 39138475237 + rerun-failed-jobs):

  • 除 2 个 ubuntu test 分片外全部 job 绿(含两个静态门禁、kernel/pi guard、config-surface-guard、unused-exports、docs、4/6 test 分片——Windows 分片在重跑后转绿,直接证明其此前的 spawn-hang 是瞬时的)。
  • 两个红 ubuntu 分片各只有一条断言失败:port-zone-live 的 #3044 unmarked lane'd spawn … exits instead of hopping(期望退出码 1 实际 3),其余数千条测试全过——本 diff 触碰的面板/插件/状态路径在分片内全绿。
  • 该失败判为环境问题的证据链:①我在同一 head 上开 ACP_TEST_CLAUDE_NATIVE=1 本地定向跑整个文件:9/9 全绿,含这条;②代码里不存在 exit(3) 路径,fail-fast 设计就是 process.exit(1)(src/server.ts:1327);③两个 runner 的 job 日志都有 ENOSPC: no space left on device(runner 磁盘写满)——14:09Z 触发风暴让多轮完整 CI 挤爆同一批 runner;④连续两轮(不同 runner、ubuntu-22/24)同签名复现,而 Windows 同族测试重跑即绿。
  • 我不再自行发起第三轮重跑(池子可能仍处 ENOSPC 退化中,避免空耗共享资源)。请从 UI 对这两个分片再点一次 re-run failed jobs;若你认可上述证据链,也可以直接合入。

已知限制(已在 PR 披露):unrouted 存储是进程内内存态——代理重启后,host 只在出现新的不同端点或 host 自身重启时才重新上报,存量端点的可见性会丢到下次。作为过渡期止血可接受,根治仍走 #1295 的 modelEndpointPatterns。

收工判定:代码层面可合(回归已修、行为已钉、方向正确、不关 #3714);CI 层面等那 2 个 ubuntu 分片转绿即可,红的部分与代码无关。

awork added 3 commits October 21, 2026 03:51
…cp_status + panel

Custom-wire endpoints (e.g. TRAE llm_utils_chat / Qoder sash agent_chat_generation)
go DIRECT at the host and never reach the proxy, so the server-side unrecognizedPaths
stat (#1290/#1291) is blind to them. Add a host->proxy report (/__bili/plugin/unrouted,
fire-and-forget on first sighting of each distinct endpoint) and surface the set where
users already look: the acp_status/compress unknown-conversation 404 now NAMES the
endpoints instead of staying generic, and the web panel shows a dedicated banner.

Pure diagnostics: no compression behavior, threshold, default, data-format, or config
change. Inputs bounded (per-path length + count cap); latest report wins per agent.
…ntax break (#3718 review)

WEB_CLIENT is a plain-JS template string that tsc/tsup never parse, so the
'const flat: string[]' added with the unrouted banner compiled locally yet
threw 'Missing initializer in const declaration' in every browser, killing
the entire panel IIFE (caught by the web-i18n new-Function pin, red on this
head vs green on master).
)

The PR's unit suite exercised handlePluginUnrouted directly but left the
shipped surface unpinned: the additive /__bili/status & /__bili/overview
'unrouted' field (parity, the #2152 lesson), the POST /__bili/plugin/unrouted
route over HTTP, and the banner rendered by the embedded client. Add a
real-server + real-WEB_CLIENT-in-vm block (pattern: upstream-alerts): empty
field before any report, sorted per-agent list after, status/overview
parity, malformed/agentless reports 400, banner names both endpoints when
reported and stays hidden when clean.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant