Repository navigation
test: e2e the #1685 plugin tool routing ladder + MCP shim lane - #1773
Conversation
Sediment of the 2026-09-30 real-machine verification matrix (issue #1611 / PR #1692 live session): every scenario was first probed against a production instance with curl, then pinned hermetically. - routing ladder: single-active arb → outbound tool_use witness (plain-JSON recording lane, 5th of #1692) beats a two-active refuse-to-guess → loud 404 on an unknown body conversation id (#1158 diagnostic) - MCP shim leg: spawns the real src/mcp.ts over stdio JSON-RPC the way a codex host drives it (BILI_MCP_PROXY + BILI_CONVERSATION_ID env only) and routes a tools/call through the body-id lane - hermetic: XDG_STATE_HOME redirected before server import — boot's loadConversations() would otherwise read the developer's production plugin-conversations.json and count live sessions as fresh conversations, breaking single-active arbitration assertions (auto-restart.test.ts env-first pattern)
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1723-pr.1773.375f376This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1773.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 PR #1773 review — Reviewed branch ① Direction. Right target. Pins the #1685/#1611/#1692 zero-injection routing ladder and the codex-style MCP-shim contract hermetically against the real ② Regression audit. Pure test addition, no source path touched → nothing existing changes. I confirmed every assertion maps onto the actual decision code (so the tests pin real invariants, not invented ones):
③ Code. Clean and deterministic (port 0, isolated XDG, ephemeral relay port, ring reset between legs). No ④ Test validity (teeth). Strong, not tautological. Test 1 walks all four rungs in order and asserts exact statuses + diagnostic substrings ( ⑤ Diff. One file, all insertions, no whitespace/reformat churn. Clean. Local evidence (I ran it): CI (this head): 9/12 green — all five real-client lanes, hermetic registry e2e, build-artifact, version-guard, and Verdict: mergeable once the three remaining test-matrix jobs finish green. Not merging myself — merges are human-only per repo rules. 中文一句话:这是纯测试新增(只加一个 e2e 文件、零源码改动);我逐条核对了它断言的四级路由阶梯与 MCP shim 契约确实对应 |
- env spreads process.env (issue760 spawnShell pattern): a stripped env loses SystemRoot/PATH on Windows and the shim dies before replying — the likely windows-lane CI failure on the first push - drive initialize → notifications/initialized → tools/call, the exact order a codex host uses, instead of a bare tools/call
src/mcp.ts exits on stdin end — the 300ms timer could kill an in-flight tools/call reply on slower CI runners (all four lanes failed this way; local runs passed by timing luck). Wait for the target reply, then kill.
Sediment of the 2026-09-30 real-machine verification matrix for #1685 (issue #1611 / PR #1692 live session). Every scenario here was first probed against a production instance with curl before being pinned hermetically.
What it covers
Routing ladder end-to-end (real
startServer, real plugin headers, zero-config/bili/relay lane):acp_statustool_use in a plain-JSON (non-stream) response — the 5th recording lane of fix: zero-injection session identity — outbound tool_use witness routing (#1685) #1692; with TWO fresh conversations arbitration can only refuse, so a 200 proves the witness matchedMCP shim leg (codex-style host): spawns the real
src/mcp.tsover stdio JSON-RPC with envBILI_MCP_PROXY+BILI_CONVERSATION_IDonly — the exact client contractbili codexexercises; assertsacp_statusreturns ACTIVE SURFACE through the body-id lane (ring reset for determinism).Hermeticity note (the interesting bug found while writing it)
loadConversations()at boot readsXDG_STATE_HOME— pointing at the developer's real state dir, a test server hydrates live production conversations into its routing table and they count as fresh, breaking the arbitration assertions (and worse, a dirty-gated flush could flow back). Fixed with the established env-first pattern (auto-restart.test.ts): XDG roots redirected before the server import, restored inafter().Verification
npm run typecheckclean