billion-context-pi 0.1.53-pr.259.47 → 0.1.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,9 +18,8 @@ type AnchorEntry = {
18
18
  };
19
19
  };
20
20
  /** True when the last valid assistant usage anchor comes strictly BEFORE the
21
- * last successful compress toolResult — i.e. the host's provider-usage
22
- * number still reflects the pre-compression request and must not floor the
23
- * meter for the next LLM call. Failed / no-op compresses do not count
24
- * (nothing was reclaimed, the anchor is still accurate). */
21
+ * last successful compress toolResult — the host's provider-usage number
22
+ * still reflects the pre-compression request. Failed/no-op compresses don't
23
+ * count (nothing was reclaimed). */
25
24
  export declare function usageAnchorPredatesCompression(entries: AnchorEntry[]): boolean;
26
25
  export {};
package/dist/index.js CHANGED
@@ -12077,10 +12077,7 @@ function wireContextTransform(pi, runtime) {
12077
12077
  const sentTokens = estimateTokens(coreMessages, coveredIds, collectImageTokens(entries, modelSupportsImages(ctx.model))) + systemPromptTokens;
12078
12078
  let tokenCount = sentTokens;
12079
12079
  const realPromptTokens = realUsage?.tokens ?? 0;
12080
- const anchorStale = usageAnchorPredatesCompression(entries);
12081
- if (anchorStale && realPromptTokens > sentTokens) {
12082
- logInfo("floor", { sid, event: "stale-anchor-skip", sentTokens, realPromptTokens });
12083
- } else if (realPromptTokens > tokenCount) {
12080
+ if (!usageAnchorPredatesCompression(entries) && realPromptTokens > tokenCount) {
12084
12081
  tokenCount = realPromptTokens;
12085
12082
  }
12086
12083
  if (ov.armed && config.modelContextLimit > 0) {