Skip to content

Lookback: count positions the way Bedrock does now (0.4.1) - #2

Merged
Haarris merged 1 commit into
mainfrom
fix/lookback-positions
Oct 30, 2026
Merged

Haarris merged 1 commit into
mainfrom
fix/lookback-positions

Conversation

@Haarris

@Haarris Haarris commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Bedrock changed how far back a cache point finds the previous entry. Measured live on Oct 30 2026 (Sonnet 4.6 and 5.5, Converse and InvokeModel): a group of tool calls side by side counts as one position, so do their results, thinking blocks don't count, and a checkpoint block always counts on its own. 21 positions still hit, 22 miss. On Oct 7 every block counted, so many parallel tool calls lost the cache; they no longer do.

  • diff: lookback-exceeded counts positions. scripts/live_lookback_positions.py checks the count against live Bedrock (52/52 on Sonnet 4.6, 24/24 on Sonnet 5.5).
  • Guides: Strands, LangChain and LiteLLM re-run live (15/15, 10/10, 14/14). The parallel tool call findings show the old and new numbers. The Strands hook and the LiteLLM helper for wide tool rounds are removed.
  • Homepage, README, llms.txt and the checker updated. live_test.py lookback case uses sequential tool calls (11/11 live).

Bedrock changed how far back a cache point finds the previous entry. Measured live on Oct 30 2026 (Sonnet 4.6 and 5.5, Converse and InvokeModel): a group of tool calls side by side counts as one position, so do their results, thinking blocks don't count, and a checkpoint block always counts on its own; 21 positions still hit, 22 miss. On Oct 7 every block counted, so many parallel tool calls lost the cache; they no longer do.

- diff: lookback-exceeded now counts positions (new scripts/live_lookback_positions.py checks the count against live Bedrock: 52/52 on Sonnet 4.6, 24/24 on Sonnet 5.5)
- guides: Strands, LangChain and LiteLLM re-run live (15/15, 10/10, 14/14); the parallel tool call findings now show the old and new numbers; the Strands hook and the LiteLLM helper for wide tool rounds are no longer needed and are removed
- homepage, README, llms.txt and the checker updated to match; live_test.py lookback case uses sequential tool calls
@Haarris
Haarris merged commit dece0e4 into main Oct 30, 2026
9 checks passed

This branch was successfully deployed

1 active deployment
pypi — dece0e4e Deployed Oct 30, 2026 by Haarris via publish-pypi #8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant