Repository navigation
Conversation
Owner
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 独立检索了 open+closed 的 issue/PR(按 pending capture / body digest / mispair / cache forensics 等失败签名,不只标题):最近的缓存取证类 PR——#4053(host 生成的 thinkingTokens 不进 client-origin 证据)、#4391(body stability 用 marker-blind 视图)、#4132(anthropic lane cached tokens 双计)、#4074(cache_creation 合成终帧)——机制各不相同,本 PR 专修「同一 Session 上两个 in-flight forward 互相覆盖 pending body/inbound/image 槽位」这一请求证据所有权问题,与它们无重叠。issue #4429 的自查重结论与我的独立检索一致。 标签: 正在做完整 review(方向关 → 回归清点 → 代码审查 → 测试有效性 → CI 状态),结论按结构化八问回复。 |
Owner
This was referenced Oct 25, 2026
ranxianglei
pushed a commit
that referenced
this pull request
Oct 25, 2026
…apture on the relay lane (#4731) #3307 P2-A's xMeasured block read the pending body/inbound pair from session.transient.sentBody/inBody, but since #4430 the relay lane keeps that pending evidence inside the withCacheCapture AsyncLocalStorage capture — transient.sentBody is never written there, so the fold-cost attribution fix was dead on exactly its target lane (stateless proxy clients) while the loop lane kept working. Add pendingEvidencePair(): both sides (outbound body + inbound view) from ONE source — the capture when present, else session.transient (loop lane, byte-identical fallback) — because a mixed read can pair an old body with new usage and mis-attribute a seam. Settled baselines (settledBody/settledInBody) stay on transient on every lane. Also document the round>=2 conservative settle (noteForwardedBody drops pending.inBody on retries, so settledInBody loses its baseline): diagnostic-only by design, semantics unchanged. Regression: tests/issue4731-cache-capture-pair.test.ts pins the relay-lane fire, the #3023 client-rewrite guard with capture-held evidence, the no-mis-pair negative (stale transient body + capture usage), the loop-lane fallback, and the same-source pair contract.
ranxianglei
pushed a commit
that referenced
this pull request
Nov 13, 2026
…suite The #4731 source fix (fold re-pay attribution reading the #4430 ALS capture on the relay lane) is already on master (e253a29) with its own regression suite (issue4731-cache-capture-pair.test.ts). This file's positive mid-history-break and #3023 client-rewrite cases are strict subsets of that suite's; only the tail-append guard on the wrapped lane is new here. Drop the two near-duplicates and the now-unused CoreMessage/noteInboundMessages imports.
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.
Closes #4429
Category A — cache forensics. Two in-flight forwards sharing a Session currently overwrite the pending body/inbound/image slots. If B sends before A completes, A's bill can be attached to B's digest and send-time facts, and A's settlement can consume B's evidence.
This change scopes pending captures to the async forward, including internal compression rounds. Completed evidence stays on the session; reversed completion order clears comparison continuity rather than inventing a prefix seam. Aborted captures release their pending references. The JSON settlement path uses the original send capture instead of re-noting a body without its original credential/parameter facts. Image learning retains the relay's first-round capture order and drops unbilled facts when advancing an internal round.
Optional capture ID/round and out-of-order evidence fields are exposed in cache reports. Legacy non-forward callers retain their API. The existing semantic classification rules, wire bodies, folding policy, session identity and baseline-writer authority are unchanged. In particular this does not resolve #1916 or prove the cause of #4328's production misses. Generated thinking-token canonicalization and capped-body attribution changes from the larger local staging patch were deliberately excluded to avoid overlapping #4053 and independent scopes.
Validation on master 50e2506 + head:
The 4-phase real-provider Codex suite has not been run and remains a pre-merge requirement for the touched request pipeline. Remote full CI test lanes on this pushed head are authoritative and must be checked; local targeted results do not imply full-suite green.
Config surface: no config fields, flags, defaults, persistence version, or kernel changes. No live installation/configuration changes were made.