Repository navigation
[PR] feat: #3714 surface direct-through-unrecognized-endpoint traffic in acp_status + panel - #3718
ranxianglei wants to merge 3 commits into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4833-pr.3718.8ea929aThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3718.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…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).
(ai: vllm-qwen/qwen3.8-27b) 审核完成。结论先行:方向正确、实现干净,但审核中发现 1 处真实回归——已直接在本分支修掉并补了行为钉(共追加 2 个 commit,已推送)。等新 head CI 全绿即可合并。 发现的回归(原 head 不能直接合的原因)
补充的测试钉(35cfc8d):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 为准)。 |
(ai: vllm-qwen/qwen3.8-27b) 进度更新(接上一条审核结论): CI 状态:审核追加的 2 个 commit(f179928 修复 + 35cfc8d 测试钉)推送后,前几轮 CI 里有一个 Windows test 分片红了。已查明与本 PR 改动无关,是 runner 环境问题:
现在新一轮 CI(触发于 15:00Z)正在跑,我盯着,出结果再报。若该 Windows 分片再次以同样签名红,就属于持续环境问题而非本 PR,届时会在 PR 上标注请人工 re-run。 |
(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 上挂的都是同一个 等这 3 个重跑分片出结果,全绿即给出最终收工判定。 |
(ai: vllm-qwen/qwen3.8-27b) 进度更新(接上一条审核结论): CI 状态:审核追加的 2 个 commit(f179928 修复 + 35cfc8d 测试钉)推送后,前几轮 CI 里有一个 Windows test 分片红了。已查明与本 PR 改动无关,是 runner 环境问题:
现在新一轮 CI(触发于 15:00Z)正在跑,我盯着,出结果再报。若该 Windows 分片再次以同样签名红,就属于持续环境问题而非本 PR,届时会在 PR 上标注请人工 re-run。 |
(ai: vllm-qwen/qwen3.8-27b) 最终审核判定(结构化八问)。head = 35cfc8d(原 commit + 审核追加的 f179928 修复、35cfc8d13 测试钉)。
CI 取证结论(head 35cfc8d,run 39138475237 + rerun-failed-jobs):
已知限制(已在 PR 披露):unrouted 存储是进程内内存态——代理重启后,host 只在出现新的不同端点或 host 自身重启时才重新上报,存量端点的可见性会丢到下次。作为过渡期止血可接受,根治仍走 #1295 的 收工判定:代码层面可合(回归已修、行为已钉、方向正确、不关 #3714);CI 层面等那 2 个 ubuntu 分片转绿即可,红的部分与代码无关。 |
…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.
35cfc8d to
fc656d3
Compare
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 sashagent_chat_generationfrom 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-sideunrecognizedPathsstat (#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_statusjust says "unknown plugin conversation".This PR propagates the host-side knowledge to the proxy and surfaces it where users already look:
POST /__bili/plugin/unrouted(fire-and-forget, first-sighting of each distinct endpoint only; healthy/routed traffic never hits it). Mirrors the 压缩接管失效后完全静默:面板与 /__bili/status 看不出压缩已停,用户全价直连直到重启才恢复 #3581 attribution-health channel.src/server/unrouted-status.ts(latest-report-wins per agent; inputs bounded by per-path length + count cap).acp_status/compressunknown-conversation 404 now names the endpoints when the instance has reported any ("…going DIRECT (uncompressed) through unrecognized endpoint(s) — X, Y … declare it via modelEndpointPatterns ([Feature] Declarable custom-wire model endpoints — route providers like commandcode's Go plan (/alpha/generate) into compression #1295)")./__bili/status+/__bili/overviewgain an additiveunroutedfield.Behavior changes (disclosed per policy)
/__bili/status&/__bili/overviewpayloads: additiveunroutedfield (empty object until first report); no existing field altered.Config surface
None — no new config/env; the eventual fix is the existing
modelEndpointPatternsfrom #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,补上关闭关键字 —— 第三批清理)