Skip to content

[PR] feat: serve a bundled favicon.ico at /favicon.ico so browser icon probes never relay upstream - #4835

Merged
ranxianglei merged 1 commit into
masterfrom
2026-10-26_4830-favicon
Oct 26, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-10-26_4830-favicon

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #4830

What

Browsers probing the proxy origin for /favicon.ico (the dsh desktop Electron frame, direct visits, pre-redirect probes) now get the bundled bili icon instead of falling through the relay onto the configured upstream — which burned a request there and logged upstream-timeout errors for a static asset no model client ever asks for (#4830's incident log carried 68 such lines and made users suspect the model service).

Changes

  • scripts/gen-favicon.mjs (new): deterministic generator — draws the panel brand mark (∞ on an accent-blue rounded square, 4×4 supersampled), encodes 16px+32px PNGs into one .ico container, writes src/web/favicon.ts. Node builtins only, zero new dependencies, byte-stable output (no timestamps).
  • src/web/favicon.ts (new, generated): FAVICON_ICO_BASE64 — a 541 B .ico shipped inside the bundle.
  • src/server/admin.ts: GET /favicon.ico answers 200 image/x-icon with the bundled bytes (cache-control: no-cache, same posture as the page shell) instead of 204.
  • src/web/page.ts: panel head declares <link rel="icon" type="image/x-icon" href="/favicon.ico"> instead of the empty data:, icon, so the tab shows a real icon.
  • tests/issue3536-favicon-local.test.ts: updated for the new asset + new structural test that the embedded constant decodes to a valid .ico (it caught a directory/payload layout bug in the generator during development); both gate directions asserted — GET /favicon.ico pinned local, while POST on the same path and other unknown paths keep the relay fallthrough.

Behavior changes (intended, disclosed per policy)

Surface Old New
GET /favicon.ico 204 empty (master only; releases ≤ v0.1.208 forwarded it upstream) 200, image/x-icon, 541 B bundled icon
Panel head icon <link rel="icon" href="data:,"> (no visible tab icon) <link rel="icon" type="image/x-icon" href="/favicon.ico"> (real tab icon)

No config surface added, no wire/protocol change, no kernel change. Non-GET requests on /favicon.ico keep the previous relay fallthrough (unchanged by this PR).

Verification

  • typecheck + full build green on the rebased head; targeted suite 3/3 green locally
  • smoke test of the built dist artifact: file reports MS Windows icon resource - 2 icons, 16x16 with PNG image data … 32x32 with PNG image data; served bytes are sha256-identical to the embedded constant; served panel HTML carries the declaration
  • full-suite verdict: remote CI on this head

@ranxianglei ranxianglei changed the title feat: serve a bundled favicon.ico at /favicon.ico so browser icon probes never relay upstream [PR] feat: serve a bundled favicon.ico at /favicon.ico so browser icon probes never relay upstream Oct 26, 2026
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-26_4830-favicon (9ea22ce)

Latest build — install this exact version

npm install -g billion-context@0.0.6243-pr.4835.640a832

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

Recent builds (commit → version)

commit version build
9ea22ce billion-context@0.0.6243-pr.4835.640a832 build
3b4f0d7 billion-context@0.0.6234-pr.4835.1c9c7ba build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei force-pushed the 2026-10-26_4830-favicon branch from 3b4f0d7 to 9ea22ce Compare October 26, 2026 10:48
@ranxianglei ranxianglei added bug Something isn't working dsh p3 scope/ui labels Oct 26, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 —— 本 PR 是 #4830 的实现项(捆绑真图标 + 本地响应);前序 #3536 只在 master 落了本地 204 backstop(v0.1.204–v0.1.208 未发布),本 PR 把该 backstop 升级为真图标;与其他开放条目无重叠。

标签: bug、dsh、scope/ui、p3(缺陷类;事故经 dsh desktop Electron 帧触发;WebUI 面;日志噪音级严重度)

八问

  1. 是什么问题: 浏览器向代理源探测 GET /favicon.ico 时落进 relay 转发到配置的 upstream(v0.1.206 事故日志 68 行 upstream-timeout),用户误以为模型服务故障,且每次探测白烧一个上游请求。
  2. 什么原因导致的: /favicon.ico 在管理面没有本地处理器,落入通用 relay;upstream 不提供该路径/超时 → 错误日志噪音。根因修复 = 把这个静态资源在本机处理掉,而不是过滤日志或加豁免。
  3. 影响范围与严重程度: p3 —— 完全不碰模型流量;仅影响会探测代理源的浏览器(dsh desktop 帧、直接访问面板);影响面 = 日志噪音 + 浪费请求 + 页签无图标。
  4. 怎么修复的: 确定性生成器脚本(Node 内建、零新依赖)绘制面板品牌标(accent 蓝圆角方块上的白色 ∞,4×4 超采样),16px+32px PNG 打进一个 541B .ico 以 base64 常量嵌入 dist;admin 路由对 GET /favicon.ico 本地回 200 image/x-icon;面板 head 声明真实 icon link。
  5. 是否有回归问题: 无。逐项审计的既有行为:非 GET 的 /favicon.ico 仍走 relay fallthrough(method gate 保留,负例测试钉住);查询串形式 /favicon.ico?v=N 仍生效(响应与裸路径逐字节相同,测试钉住);其他未知路径仍走 relay(负例测试钉住);page shell 缓存语义不变;wire/协议、kernel、持久化格式均无触碰。两处有意行为变更(PR 正文已披露,我复核属实):① GET /favicon.ico:release ≤v0.1.208 为 relay→upstream、master(The favicon.ico request in the dsh settings panel is being routed into proxy forwarding (hitting upstream and returning | dsh 设置面板里的 favicon.ico 请求掉进代理转发(打到上游 403),面板静态资源路径应全部由管理面自答 #3536,未发布)为 204 空 → 现在 200 + 541B 捆绑图标;② head 图标 data:,(无可见页签图标)→ /favicon.ico(真实页签图标)。
  6. 是否破坏缓存: 不涉及 —— 模型 prefix cache/会话缓存零触碰;HTTP 层新资源用 no-cache(每次 load 重新验证,与 page shell 姿态一致),不会跨版本钉死旧图标字节。
  7. 是否改了设计方向: 不涉及 —— 纯静态资源面本地化,无架构/边界/数据流转向。
  8. 是否引入了新的配置: 无。

独立验证(未依赖 PR 自述)

  • 字节稳定性: 重跑 node scripts/gen-favicon.mjs → git diff 为空(输出无时间戳/随机性);从嵌入 .ico 解出两张 PNG,file(1) 均为合法 RGBA,目视确认 = accent 蓝圆角方块上白色 ∞,与 topbar 品牌一致。
  • 结构测试有牙: 新增 .ico 解码测试校验头字段/dir entry/PNG magic/偏移/尺寸/无尾部字节,开发期实际抓到过生成器的目录/payload 布局 bug。
  • 门禁双向 (Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 纪律): 正向(GET 本地钉住、响应与嵌入常量逐字节相等、favicon 零上游命中)+ 负向(POST /favicon.ico 与其他未知路径仍 relay,hits 列表精确匹配)。
  • 本地: rebase 后 typecheck + build 干净,定向套件 3/3 绿。
  • rebase 新鲜度: 接单时分支落后 master 3 个提交(degenerate-retry.ts + 其测试,与本 PR 文件零交集)→ 我已 rebase 到最新 master 341e76c 并推送,新 head 9ea22ce(force-with-lease;推送前已核实远端分支自接单以来无任何他人提交)。
  • CI: 旧 head 3b4f0d7 全绿(37 success / 14 skipped = 门控 e2e 车道);rebase 后新 head 的 CI 正在跑,绿了另报一行确认。

diff 整洁度: 5 个文件,每一行都服务于本 PR 目的;无无关改动/空白重排。gen-favicon.mjs 作为生成物来源留在仓内(可审计/可再生),合理。

判定: 可合并(待 rebase 后 head 的 CI 转绿最终确认)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

rebase 后 head 9ea22ce43 的 CI 终审结论(run 40310263123,其余同 sha 触发波为镜像重复事件,已被并发组自动取消/跳过,以 push 事件 run 为准):

车道 结果
全部静态门禁/guards(plan、unused-exports、kernel-guard、config-surface-guard、docs-sync/coverage、lock-sync、lane-guard、lifecycle-ledger-guard、test-import-graph、version-guard、pi-subagents-guard、build-artifact) ✅ 全绿
mysql-contract、static-gates(ubuntu24 / windows22) ✅ 绿
test 分片 ✅ 11/12;❌ 1 红 = test (ubuntu-latest, 22, 3)

唯一红分片是继承性 born-red,与本 PR 无关:

分支侧无需任何改动;手动重跑该 job 在簇 1 收敛前仍会确定性红。状态已按政策一行报到 #4599。

最终判定更新:代码可合并。 检查矩阵上唯一红条是 master 侧继承红(在本 PR 自己的 base 上即已存在);待哨兵把簇 1 修复收敛后重触发即全绿,owner 知悉继承红的前提下也可直接合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 自动修复车道(attempt 1/2)结论:独立复核(GitHub API 拉取 job 日志 + 本地 git 比对,不依赖 floor 3/4 既有结论)——唯一红分片是 master 侧继承红(CI 总控板上簇 1),与本 PR 无关;分支侧无需任何改动。不开新 issue:簇 1 已在 #4599 板上有名有姓(首坏提交 + clean-master A/B 俱全),由哨兵收敛中;政策 2026-10-24 明令 CI 问题禁开新 issue,状态已一行报到 #4599(floor 293)。

复核证据(每条独立取得):

八问

  1. 是什么问题:本 PR CI 唯一红条是 master 侧继承红(存储引擎 google-wire 持久态 golden 哈希漂移),不是本 PR 代码缺陷。
  2. 什么原因导致的:After model switch / client-side history rewrite, all message identities (content hashes) are replaced: ACP numbers re-m | 切模型/客户端重写历史后,消息身份(内容哈希)全部更换:acp 编号重铸、折叠覆盖大规模重挂、死 ref、churn 区临时膨胀重折 #4316 PR3/3(380ef4dac)的一次性 ledger restamp 改变了 unified store 持久态内容,超出测试「one-time ledger alignment」容差(e51851a3… ≠ e47232f3…);早于本 PR base,clean-master A/B 确认确定性红。
  3. 影响范围与严重程度:波及所有基于当前 master 的分支(凡含 storage-engine-proofs 的分片都红);对本 PR 功能本身零影响(favicon 本地响应不受牵连);本 PR 合并仅被这条继承红挡住。
  4. 怎么修复的:分支侧无修可修——根因在存储引擎 re-stamp 语义,须由哨兵把修复(或 golden 裁决)收敛进 ci-fixes/master,属 After model switch / client-side history rewrite, all message identities (content hashes) are replaced: ACP numbers re-m | 切模型/客户端重写历史后,消息身份(内容哈希)全部更换:acp 编号重铸、折叠覆盖大规模重挂、死 ref、churn 区临时膨胀重折 #4316 的决策面;本车道职责是定性与上报,已完成。
  5. 是否有回归问题:无——本 PR diff 未做任何改动;既有行为审计维持 floor 3 结论(非 GET /favicon.ico 仍 relay fallthrough、查询串形式生效、其他未知路径仍 relay、wire/kernel/持久化零触碰)。
  6. 是否破坏缓存:不涉及(模型 prefix cache/会话缓存零触碰)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:无。

判定:代码可合并(维持 floor 4 结论) —— 检查矩阵上唯一红条在 PR 自己的 base 上即已存在,与本 PR 零交集;待哨兵把簇 1 收敛进 ci-fixes/master 后重触发即全绿,owner 知悉继承红的前提下也可直接合并。若收敛前 attempt 2 再触发,结论不变,无需重复分析。

@ranxianglei
ranxianglei merged commit c8e3e64 into master Oct 26, 2026
89 of 131 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.864-master.c8e3e64 (rolling master tag).

npm install -g billion-context@0.0.864-master.c8e3e64  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

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

Labels

bug Something isn't working dsh p3 scope/ui

Projects

None yet

1 participant