Skip to content

prune: isCovered misses base-id coverage when block effective ids use sub-id forms (base#suffix) #231

Description

@ranxianglei

Found while investigating billion-context-pi #336 (closed PR #225).

Bug: isCovered(id, covered) in src/prune.ts only tests exact id membership. If a compression block's recorded effective message ids use sub-id forms (base#callId, base#r0, …) while the current projection emits plain base (or vice versa after a projection change), coverage checks fail and already-compressed messages re-enter the visible view resurrected (measured: a 762K-token leak in replay after introducing thinking sub-id projections).

Fix: normalize to the base id before membership — covered.has(id) || covered.has(base) || any covered entry shares the same base prefix. Currently latent (no shipped adapter projects sub-ids), but it bites anyone who extends the projection.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions