Repository navigation
[PR] msgid: server-side record on all four wires + GA pin rollout (#6525/#6539) - #6540
Closed
ranxianglei wants to merge 1 commit into
Closed
ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
…6539) Complements the client-side envelope wiring (#6532 shipped dsh openai+ anthropic). This is the 'record' half of the msgid lifecycle made whole across every wire: - prepare-google / prepare-responses: read + strip the biliMsgIds envelope before it can reach the upstream, then pin behind the same rollout gate as the openai/anthropic twins. A length/shape mismatch is rejected (bail) at the pin — never leaked, never mis-pinned. - handle.ts: a non-body id source (x-bili-msg-ids header / loopback harvest) now stamps the parsed body on EVERY wire, not just openai/anthropic, so the four pin-consumers all see it uniformly. - rollout: pluginLaneServerHistory 0% -> 100% (GA, owner ruling 2026-11-13). No client calls the co-gated /__bili/plugin/render endpoint yet, so flipping only activates pinning. Roll back with BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY=0. Three tests that pinned the old default-off contract now force the off state explicitly (env=0) instead of deleting the var.
Contributor
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9563-pr.6540.e9ac0f7This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6540.tgz
npm install -g packageInstall instructions are refreshed on each push. |
This was referenced Nov 13, 2026
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
msgid: server-side record on all four wires + GA pin rollout
One-line: makes the record half of the msgid lifecycle work on every
wire (openai / anthropic / google / responses) and turns the pin rollout
on by default — complementing #6532, which wired the send half for dsh
(openai+anthropic).
Part of the full-lifecycle plan in discussion #6539 (发/记/用, lane-
independent, all protocols). This PR is the server-side foundation: once
any client stamps the
biliMsgIdsenvelope (or the header/harvest seamsdeliver ids), the proxy records real host identity into
messages.msg_idon all four wires.
What changed
1.
prepare-google.ts/prepare-responses.ts— pin paths (new)Read + strip the
biliMsgIdsenvelope before anything reaches the realupstream, then pin behind the same
pluginLaneServerHistoryrollout gateas the existing openai/anthropic twins. A length/shape mismatch is
rejected (bail) at the pin — never leaked to upstream, never mis-pinned.
Google/responses have no watermark fast-path, so there is no
wpHitskip(the openai twin skips pinning on watermark hits by design).
2.
handle.ts— non-body id sources stamp every wireA non-body id source (the
x-bili-msg-idsheader, or loopback identityharvest) previously stamped the parsed body only on openai/anthropic. It
now stamps on all four, so every pin-consumer sees the ids uniformly.
The harvest path itself still reads
parsed.messages(openai/anthropicshape) — unchanged.
3.
rollout.ts—pluginLaneServerHistory0% → 100% (GA)Owner ruling 2026-11-13 (see #6539 §6.1): pinned by default. The pin is the
intended end-state of the msgid infrastructure — stamped ids become the
recorded
messages.msg_id, so the resolve/settlement/fork consumers readreal host identity instead of content digests. The co-gated
/__bili/plugin/renderendpoint stays inert until a client opts in(no client calls it yet — verified by grep). Roll back with
BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY=0.4. Three tests updated — they asserted the old default-off contract
(
delete env/ "default 0% = hidden"). They now force the off stateexplicitly (
env=0) so they keep testing both gate states under the newGA default.
Verification
npm run typecheckclean.msgid-rule-parity, msgid-pin, openai-msgid-pin, plugin-render-endpoint,
msgid-lane-flow, issue5719-msgid-lane-identity, seq-interval-lane,
cache-proof, responses-ws-http-fallback, dsh-fork-adopt,
pi-omp-fork-adopt, plugin-fork, identity-harvest — 178/178.
-mid-developer, -offhead-system) — 17/17 (confirms the new read+strip
doesn't disturb normal google/responses traffic).
Boundaries / follow-ups (in #6539)
but are routed to the incremental lane only, not the full-resend
envelope — next slice.
walkers (none exist today) — separate slice.
rows can be retired by digest re-ingest — pre-existing design behavior,
now the main follow-up to make recorded identity stable across turns.
content-derived).
Related: #6525 (gap audit), #6539 (full-lifecycle proposal), #6532 (dsh
send), #4491 (pin), #5825 (parity), #5719/#5759 (resolve consumer).