Repository navigation
[PR] feat: outbound-prefix LCP triage line for prompt-cache-break diagnosis (#5385) - #5386
ranxianglei wants to merge 6 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9074-pr.5386.eeb3b7cThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5386.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 本单对应 GitHub PR #5386(分支 标签: 独立审核结论(不是复读 PR 描述,以下全部在 PR head
|
…eaks (#5385) Add observeOutboundPrefix() (src/server/outbound-prefix.ts), an opt-in observation instrument wired into prepareAnthropic right after the final rebuiltMessages assembly. Gated behind the existing ACP_DUMP_BODY / diagnostics.dumpBody knob (off by default, zero overhead when off): each turn it fingerprints the rebuilt outbound messages, stores the previous turn's list in session.metadata, and logs the longest-common-prefix length plus the exact message index where two consecutive outbound histories first diverge, together with cache_control positions. Log-only; never touches wire bytes. Directly answers #5385's ask ('which message index first differs between consecutive outbound requests'). No behavior change when the knob is off.
e20f157 to
7ca0011
Compare
…lve prepare-anthropic.ts conflict (#5385) Master refactored the outbound rebuild tail (#5604 ensureUserTail -> #5688 dedupeAdjacentOutputConfig -> #4570 healAnthropicSystemPositions), so the PR's observeOutboundPrefix hook now runs on the final sent array (healedMessages) instead of the pre-heal rebuiltMessages, keeping both intents.
(ai: vllm-qwen/qwen3.8-27b) 查重: 不适用 —— 本任务是该 PR(#5386)的 CI 接冲突车道(合并冲突自动修复),不是新缺陷/新功能立项,没有可重复的并列工作。 What I did this run
The conflict, in one lineMaster refactored the outbound-rebuild tail in 结构化八问
判定:冲突已解决并推送成功(fast-forward 至 |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不适用 —— 本任务是该 PR(#5386)的 CI 接冲突车道(合并冲突自动修复),不是新缺陷/新功能立项,没有可重复的并列工作。 What I did this runThis was a re-trigger: after my previous fix I pushed
结构化八问
判定:已把最新 master 合入并推送成功(fast-forward 至 |
[bot] 🏷 This run: stale re-fire — verified live there is NO conflict and NO red CI, so nothing to fix. Branch left untouched (no push, no edits). Live evidence (checked this run, not from memory):
结构化八问(本轮)
判定 / 剩余事项:冲突与红 CI 均不存在(前者本轮核验确认,后者镜像缓存 16 绿 0 红)。 |
…map (#5385) The architecture-docs CI gate requires every tracked src/ file in the map; the new module was missing, so the lane would fail at this head.
…hem silently (#5385) Aligns with the noteMsgIdObservation precedent (warn + context); a failing observation while body dumps are enabled for triage should be visible.
… suite (#5385) Covers the cur-shorter-than-prev path: lcp/prev counts, BREAK index and the <end> sentinel for the missing tail cell.
|
(ai: vllm-qwen/qwen3.8-27b) Verdict: APPROVE — log-only diagnostic instrument, correctly scoped; no wire/config/kernel changes. Three small mechanical findings fixed directly on this branch (receipts below); nothing else blocks. What it does. Correctness checks.
Tests. All six original cases have teeth — exact log level + regex on the emitted line, and both gate directions per #3617 (fires on shrink, quiet on append). The only untested branch of the detail string was the shrink case (current list shorter than previous → Regression audit (existing behavior on the touched paths).
Findings fixed on this branch (per owner policy 2026-11-01):
The author merged current master into the branch (7bd548e) just before these fixes landed; they are stacked on top, and the architecture-docs guard passes again at the pushed head. Full-suite verdict: remote CI on 2bffbe3. 八问(中文,供人工复核):
APPROVE — merge-ready, pending CI green on 2bffbe3. |
[bot] 🏷 Review lane complete: GitHub PR #5386 reviewed end-to-end — verdict APPROVE (posted on the PR thread as a comment; a formal review event is impossible from the author's own account). Three small mechanical findings were fixed on-branch per policy and pushed: architecture-map line (cef0993), silent catch → warn log (f8015e7), missing shrink-case regression test (2bffbe3); new head 2bffbe3. Locally verified at head: architecture-docs guard green, edited files syntax-clean, no kernel/config/wire changes, no open findings left unfixed or parked. Full-suite verdict: remote CI on 2bffbe3. Nothing blocks — ready for human merge once CI is green. |
What
Adds an opt-in observation instrument that directly answers the diagnostic ask in #5385 ("is there a diagnostic for which message index first differs between consecutive outbound requests?").
New module
src/server/outbound-prefix.ts, wired intoprepareAnthropicright after the finalrebuiltMessagesassembly (src/server/prepare-anthropic.ts). Each turn it:cache_controlpresence | length | djb2 hash of the bytes),session.metadata,cache_control.Example lines:
Log-only. It never touches wire bytes. When the knob is off (the default) the function returns immediately — zero overhead, zero behavior change.
Why this shape
ACP_DUMP_BODY/diagnostics.dumpBodyknob (off by default). No new config field, no new env var — so no config-surface change. Enable it on the affected session to collect the data.Verification
tests/issue5385-outbound-prefix-diff.test.ts: off-by-default no-op (no log, no session-state write), first-turn baseline, healthy tail-append (debug, no BREAK), head change (info,BREAK@0), mid change (info,BREAK@1+cc@[..]), same-length re-encoding caught by content hash. All pass.npm run typecheckclean (kernel/ + pi-subagents/ pre-hook builds OK). Full-suite verdict = remote CI on this head.Scope note
This is instrumentation only — it does not fix #5385. It produces the evidence needed to distinguish the two remaining candidate mechanisms (mid-history fold churn vs. extra per-turn byte instability) once the reporter enables it on the affected session. #5385 stays open pending that data.