Skip to content

ACP compression refs become stale after context generation updates #7253

Open

Description

@monswag

The ACP prompt can expose live compressible ranges beyond m00342 (for example m00342–m00550), while the compression/status tools continue to report a session ledger ending at m00342. Compressing the listed ranges then treats later refs as unknown or compresses only 1245 characters and fails the 5000-character minimum. A fresh acp_status also reports only the older m00001–m00342 ledger. Please investigate ref synchronization across context generations and make the tool surface one consistent live range set (or provide a generation identifier that prevents stale ranges being offered). No project/user data included.

Activity

  1. ranxianglei commented on Nov 19, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

    (ai: vllm-qwen/qwen3.8-27b)

    Labels applied: bug + scope/wiring + p2 — defect in the protocol-wiring layer (the tool call binds to a different session state than the model request); usable but the advertised compress ranges are wrong, needs a workaround.

    Duplicate screening: Same symptom family as #6063 / #6874 / #6061 — "the compression nudge / ACP prompt advertises compressible ranges that the compress/acp_status tools cannot anchor, after a context-generation reset." Not a 100% duplicate: your specific shape (tool-side ledger ending at m00342 while the ACP prompt advertises m00342–m00550, the range starting exactly where the tool ledger ends) is a new data point, and the exact mechanism is not yet pinned to one of the known sub-causes. Cross-linking, keeping open.

    Version-first triage (need this before I can confirm the mechanism): the report doesn't state a bili version, and the generation-reset wiring changed several times in the last few releases — the mechanism differs across versions. Could you provide:

    • bili --version (or the startup log line),
    • the client/host (dsh / opencode / pi / codex / claude-code / omp),
    • what triggered the "context generation update" (a model switch? a proxy restart? a native /compact? a persona/system-prompt change?),
    • the exact acp_status output you saw (the compressible-ranges section + the ref-ledger end) and the exact compress error text.

    Initial mechanism read (to confirm against your version + client): within ONE session object the three surfaces (nudge / acp_status / compress) provably share one ledger — range endpoints are minted exclusively from state.messageRefs.byRaw (kernel/src/recommend.ts:332). So a divergence like yours means the model request (ACP prompt) and the tool calls (compress/acp_status) bound to two different session states around the generation boundary. The tool side sits on the older generation (refs through m00342) while the model request is on the newer one (refs through m00550) — so compress m00342–m00550 resolves only m00342 (1245 chars, under the 5000-char floor) and treats m00343–m00550 as unknown.

    The tool-routing ladder (src/plugin.ts:2315-2379) already follows a live |sub: fork for native callers (personaLineageWitness / livePersonaDescendant), but that follow only fires when the caller is host-stamped (nativeCaller). A plain MCP-shim / non-native tool call addressing the raw conversation id stays on the frozen parent — the most likely shape here. I'll confirm against your version + client before touching code.

    Related in-flight PRs (checking overlap, none merged yet): #5548 (make generation resets observable), #5683 (ascending ref-pair display after a reset), #6362 (arm the rebase on a proven ref-ledger reset). I'll verify none of them already closes this specific split before implementing.

  2. ranxianglei commented on Nov 19, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    查重 (duplicate screening): Same root-cause family as #7075 / #6452 (session-resolve aggregation) / PR #7202 (stalePersonaWithRefs) — the "request silently mapped to the wrong session object" family, specifically the tool-loop routing miss failure point. Not a 100% duplicate: your framing is the ACP prompt (nudge) advertising ranges the tool side can't anchor, while #7075 is the compress error itself. Cross-linking, keeping open pending version confirmation.

    Version-first triage (required before code-level analysis): The issue body doesn't state a version. Please provide:

    1. bili version (bili --version or the startup log line).
    2. Client/host (dsh / opencode / codex / claude-code / other).
    3. Trigger — what happened right before the divergence (proxy restart? upstream/model switch? upgrade? persona change?).
    4. Exact output of acp_status (the full report) and the compress call that failed (the error message).

    Initial mechanism hypothesis (pending version confirmation):

    The symptom — ACP prompt advertises m00342–m00550 while the tool side reports a ledger ending at m00342 — is the signature of split session binding: the model request and the tool calls (compress/acp_status) are bound to different session objects with different ref maps.

    • The model request is on a session whose ref map extends to m00550 (the "live" session — either a |sub: persona fork or a post-reset generation).
    • The tool calls are bound to a different session whose ref map ends at m00342 (the "frozen" parent or the pre-reset generation).

    The ACP nudge is computed from the model request's session state; the compress/acp_status tools are computed from the tool call's session state. When they diverge, the nudge advertises ranges the tools can't anchor.

    In-flight work that may already cover this:

    If your version is pre-#7202 and pre-#5590, the fix is likely already in flight. If your version is post-both and you're still hitting this, that's a new data point that would indicate a gap in the existing fixes — please share the version + logs so I can confirm which case you're in.

  3. ranxianglei commented on Nov 19, 2026

    @ranxianglei
    Owner

    (已收)本单已归入根因聚合 issue(token 见聚合单 body),机器人已停止在本单上的工作,修复走聚合 issue 统一出 PR;本单保留不关,修复验证后统一关闭。(聚合单:[Root Cause] kernel-identity (3 items),GitHub #7255)

  4. ranxianglei commented on Nov 20, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    收到。本单已归入聚合单 [Root Cause] kernel-identity (3 items)(GitHub #7255),机器人停止在本单上的工作,本单保留不关,待聚合单修复验证后统一关闭。

    补充一点供聚合单参考:我此前的初诊假设是 split session binding(模型请求与工具调用绑定到不同会话对象,属 session-resolve 路由面,与 #7075/#6452 同族),但 owner 归类为 kernel-identity——说明根因判定指向 kernel 侧的 ref 编号/消息身份机制,而非 host 侧的会话路由。两个假设在症状层面吻合(ACP prompt 与工具侧 ledger 分裂),但根因层次不同。聚合单 #7255 做根因分析时,建议同时验证:① 模型请求与工具调用是否绑定到同一会话对象(排除 session-resolve 路由分裂);② 若同一会话,ref 编号在 kernel 侧是否一致(kernel-identity 机制)。初诊中已交叉链接的相关条目:#7075 / #6452 / PR #7202 / PR #5590。

    本单不再继续。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions