Skip to content

[PR] docs: host plugin integration contract - stable status/origin routes for third-party UI plugins (#4319) - #4447

Closed
ranxianglei wants to merge 2 commits into
masterfrom
2026-10-24_host-plugin-contract-docs
Closed

ranxianglei wants to merge 2 commits into
masterfrom
2026-10-24_host-plugin-contract-docs

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Extracted from PR #4327 per owner decision in #4319: the tab-naming/hiding side of the dsh-context coexistence work already shipped via merged PR #4238 (dsh.contextTab / dsh.contextTabLabel knobs), so only the stable-contract documentation remains from #4319's accepted scope.

What this adds (docs only, 3 files, +27/-2)

What is intentionally NOT here

The tab rename, banner rewording + repo link, and config-page note from original PR #4327 are dropped per owner decision (the tab side is covered by #4238). That content stays recoverable on branch 2026-10-22_dsh-coexistence-tab-docs if ever wanted back.

Verification

Docs-only change: no code, no config surface, no wire/persistence impact. CI gates are the verdict.

Closes #4319

Extracted from PR #4327 per owner decision: the tab-naming/hiding side of the dsh-context coexistence work already shipped via merged PR #4238 (dsh.contextTab / dsh.contextTabLabel knobs), so only the stable-contract documentation remains from #4319.

- README: new 'Host plugin integration' section — GET /bili/origin shapes (incl. the #4237 face flags, marked internal), GET /__bili/plugin/status stable field set, error shapes, loopback admin gate + trusted-Origin/CORS caveats, additive-evolution promise.
- CLIENTS.md: pointer from the dsh Context-tab paragraph to that section.
- PLUGIN.md: cross-ref in the status-route subsection for non-cooperative third-party readers.
@ranxianglei ranxianglei changed the title docs: host plugin integration contract - stable status/origin routes for third-party UI plugins (#4319) [PR] docs: host plugin integration contract - stable status/origin routes for third-party UI plugins (#4319) Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-24_host-plugin-contract-docs (ed3e8da)

Latest build — install this exact version

npm install -g [email protected]

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
ed3e8da [email protected] build
caf4dca [email protected] build

Download artifact

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

Install instructions are refreshed on each push.

… profiles

Review fix on #4447: the route registers only when a dsh web server exists
(src/agent/dsh-native.ts — TUI/headless profiles never fire the callback),
so 'older host build' was an incomplete account of the 404 case.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。这是 #4319 里 owner 拍板后从 #4327 拆出的纯文档部分(tab 命名侧已由合并的 #4238 覆盖),open/closed 里没有其他 issue 或 PR 覆盖这个文档范围。相关条目:#4319(本 PR 关闭它)、#4327(源 PR,见文末)、#4238(已合入)。

标签: dsh + scope/docs + p3(dsh 车道的第三方集成文档补齐,无运行时影响)。

已把 README、CLIENTS.md、PLUGIN.md 三处改动逐条对照 master 代码核实过:两条路由的响应形状({origin} / {origin:null,relay:true} / {origin:null})、400/404 错误文案、phase 取值、loopback 管理门与可信 Origin 规则(含 dsh-app://app)、CORS origin 回显、字段清单与 PLUGIN.md §4 的一致性——全部与源码一致(src/agent/dsh-native.ts、src/server/admin.ts、src/plugin.ts),README 里"未列出的字段不保证稳定"的表述也成立。

八问:

  1. 是什么问题:不是缺陷,是文档缺口——第三方宿主侧 UI 插件(如 dsh-context)读 bili 的 wire 口径数字,只有两条路由的隐式行为,没有写给非协作插件读者的稳定契约说明。
  2. 什么原因导致的:/bili/origin(dsh web端和桌面端点击bili设置显示未启动 #1809)和 /__bili/plugin/status([Bug] Inconsistent host-side context statistics after compression in dsh plugin mode (ref: dsh-context#173) | [Bug] dsh 插件模式压缩后宿主侧上下文统计不一致(引用 dsh-context#173) #3862 等)都是作为内部功能长出来的;PLUGIN.md §4 面向的是协作插件,没有面向跨客户端第三方的契约陈述,[Feature] Coexistence with dsh-context: Session tab name collision, cross-linking, and /__bili/plugin/status contract (o | [Feature] 与 dsh-context 共存:会话标签页重名、互链与 /__bili/plugin/status 契约(可选) #4319 的共存工作把这个缺口暴露出来,tab 侧走 [PR] fix: dsh lane: rename + hide switch for the top-bar Context tab (#4237) #4238 落地后只剩文档。
  3. 影响范围与严重程度:docs-only,零代码/配置/wire/持久化改动;只影响第三方插件作者的集成可读性。无运行时影响。
  4. 怎么修复的:README 新增 "Host plugin integration" 一节(两条路由的目的、响应形状、错误形状、访问门、加法演进承诺),CLIENTS.md 与 PLUGIN.md §4 各加一句交叉指引;所有陈述逐行对照代码验证。
  5. 是否有回归问题:无——没碰任何代码路径。审过的既有行为:两路由的响应/错误文案、phase 语义、访问门与 CORS 行为,均与代码逐字一致。发现一处措辞不完整已当场修掉(见下)。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:无架构转向;但这一节首次把 plugin status 字段集写成了对外加法演进承诺(只增不改语义)——这是后续产品层面的约束,值得注意。
  8. 是否引入了新的配置:不涉及。

review 中发现并已修(独立 commit ed3e8dace,已推到 PR 分支):README 原来只说 /bili/origin 路由不存在 = "旧 host build",但 TUI/headless profile(不起 web server)同样不注册这条路由(src/agent/dsh-native.ts:1700-1726),已补成"host build predates the route, or the dsh profile has no web server (TUI/headless)"。

一个需要你决定的点:PR 正文说稳定字段集"incl. contextView",但 contextView 在 PLUGIN.md §4 和 README 清单里都没有出现——按这一节自己的规则,它就是"未列出、不保证"的内部字段。如果你想把它纳入契约,得先在 PLUGIN.md §4 补文档(单独决定);否则正文那句括号是过时的。我没动 diff,等你拍板。

另外:#4327(源 PR)现在被本提取 + #4238 完全取代,仍开着,建议由你关闭(agent 无权关 PR)。

CI:新 head ed3e8dace 当前 20/30 check 完成、0 失败,其余在排队;docs-only 变更,以 CI 全绿为最终判据。

判定:可合(待 CI 全绿);contextView 一句按你的决定处理即可,不阻塞。

@ranxianglei

Copy link
Copy Markdown
Owner Author

位置不对 直接关闭

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

Projects

None yet

1 participant