Skip to content

[PR] feat: four-host msgIds wiring on the incremental lane (dsh/pi/opencode/omp) (#4491 host batch) - #4523

Merged
ranxianglei merged 5 commits into
masterfrom
2026-10-24_host-msgids-assembly
Oct 24, 2026
Merged

ranxianglei merged 5 commits into
masterfrom
2026-10-24_host-msgids-assembly

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

背景

#4491 服务端地基(#4505)已合:lane 接受 msgIds(与 messages 平行的宿主消息 id 数组,严格校验),但还没有任何宿主真的发。本 PR 补上四宿主接线,插件车道的服务端正史从「休眠」变「通电」。

改动(每宿主一个 commit,冲突在 incremental-client.ts/pi.ts 已合并)

  • dsh:llm/stream 的 options.messages[].id 挂进既有 Why did it spike to several M tokens: after dsh attribution was lost, requests bypassed bili and were sent directly, ren | 为什么会涨到几 M tokens:dsh 归因丢失后请求绕过 bili 直发,压缩与护栏全部失效 #4082 ALS 作用域(作用域载荷从裸 sid 扩为 {sid, msgIds}),发送时与实际 wire 消息 1:1 对齐才带;侧车(compaction/title)无 id→整轮降级。客户端侧校验镜像(不 import 服务端模块的纪律)。
  • pi:扩展层 CoreMessage.id(新模块 src/agent/pi-msgids.ts,validateMsgIds 直接复用服务端校验)+ lanePinnableContent 对齐。
  • opencode:V1 messages.transform 的 info.id 采集(opencode-msgids.ts harvest + 对齐)。V2 http.request 只见 wire 拿不到 id——V2 形状降级为内容派生(四宿主最弱一环,issue 里已有记录)。
  • omp:sessionManager.getBranch() 树条目 id,before_provider_request 快照 hint(TTL 30s)+ count/role 双对齐;另持 msgidClaims 本地镜像——已上车过的 id 重试时降级,不撞 lane 的 400(重复认领硬失败)。
  • 共享传输:planIncrementalTurn 的 PlanArgs.msgIds(数量不齐本地丢弃)+ delta 轮 slice 对齐。

全或无纪律贯穿四宿主:任一消息拿不到合格 id(缺失/重复/acp_summary_ 保留前缀/空白控制字符/超长/数量不齐)→ 整轮不带字段,服务端回落内容派生 id;宁可降级绝不错配(错配=给错身份,不可逆)。

测试

新增 tests/{pi,dsh,opencode,omp}-msgids.test.ts(5/5/5/6 例,hermetic mock harness):带 id 上车+对齐/部分无 id 降级/侧车形状降级/重复 id 降级/count 不齐不发。

组装分支复验(四分支合一后):四套 msgid 桩全绿 + msgid-pin 9 + msgid-algebra 14 + plugin-render-endpoint 7 + msgid-lane-flow 5 + incremental-lane 24 + tsc 0 + unused-exports clean。

备注

Part of #4491(服务端地基=#4505,本 PR=宿主接线批次)。

…ost wiring)

The llm/stream dispatch scope now captures the host's per-message ids
alongside the session id (#4082 machinery), and the incremental turn
envelope carries them as msgIds when — and only when — they line up 1:1
with the wire messages actually sent. All-or-nothing per turn: sidecar
shapes (compaction/title) and any unusable id degrade to an id-less turn,
never a guessed pairing. planIncrementalTurn drops a count-mismatched
list locally so a caller alignment bug can never pin a wrong id.
@ranxianglei ranxianglei changed the title feat: four-host msgIds wiring on the incremental lane (dsh/pi/opencode/omp) (#4491 host batch) [PR] feat: four-host msgIds wiring on the incremental lane (dsh/pi/opencode/omp) (#4491 host batch) Oct 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-24_host-msgids-assembly (5d9029e)

Latest build — install this exact version

npm install -g billion-context@0.0.5457-pr.4523.7714a8b

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
5d9029e billion-context@0.0.5457-pr.4523.7714a8b build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr4523.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

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

查重: 不重复。open issue/PR 里检索 msgIds / incremental lane 宿主接线,无其他在途同主题工作;本 PR 是 #4491 的宿主接线批次(服务端地基 #4505 已合),与既有 PR 无重叠。

标签: dsh pi opencode omp scope/wiring p3(四宿主协议接线;rollout 门仍 0%,当前对用户无行为变化,故 p3)。

状态: 已拉取 PR head 2026-10-24_host-msgids-assembly @ 5d9029ef4(base = 当前 master c81c17d93,最新)。CI 40 项中 38 项绿/skip,docs-sync 红——正在查原因。代码按八问逐项审,审完给结论。

@ranxianglei
ranxianglei merged commit 3138bda into master Oct 24, 2026
39 of 40 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.814-master.3138bda (rolling master tag).

npm install -g billion-context@0.0.814-master.3138bda  # 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant