| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…che byte-identity filterCompactedEffect(sessionID) reloads all messages from the DB at the start of every prompt loop iteration. Between reloads, the DB returns rows with new object identity, breaking Anthropic's prompt cache which relies on byte-identical prefixes. Cache messages across loop iterations — first iteration does a full load, subsequent iterations only append new messages by ID. Full reload is flagged after subtask, compaction, or overflow operations.
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: Related PR:
However, this is a related but distinct fix. PR #36852 is a re-filed version of the earlier #31527 (which was auto-closed by the cleanup bot), so it's not a duplicate—it's a rebased continuation of previous work. No duplicate open PRs found addressing the exact same message caching mechanism across prompt loop iterations. |
Sorry, something went wrong.
|
Closing this. After a deeper look, the original rationale doesn't hold and the patch isn't worth the risk:
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Issue for this PR
Closes #31525
Type of change
What does this PR do?
filterCompactedEffect(sessionID) reloads all messages from the DB at the start of every prompt loop iteration. Between reloads, the DB returns rows with new object identity, breaking Anthropic's prompt cache which relies on byte-identical prefixes.
This PR caches messages across loop iterations:
This preserves object identity for existing messages across iterations, improving prompt cache hit rates.
Re-filing of #25367 which was auto-closed by the cleanup bot.
How did you verify your code works?
Tested locally with multi-turn sessions. Verified via logs that message count stays stable across iterations and only new messages are appended after tool calls.
Screenshots / recordings
N/A — backend performance improvement.
Checklist