feat: hand back the colliding note, not just its id (0.7.3) - #44
Merged
Conversation
The last piece of the capture pipeline, and the one that survived contact with `brief`. A title collision reported the other note's id and stopped there. Deciding what to do with it — merge a duplicate, supersede a changed claim, or link a genuine contradiction — needs that note's words, and getting them meant a second `agent-memory get`. On a biller that charges per prompt rather than per tool call, that is another request for something `write` already had in hand. It now returns the existing note's type, title and a clipped body, so the fix happens in the turn that found the problem. One extra row is read, and only when a collision actually occurred; bodies are still not loaded for the whole store to describe the one that collided. The excerpt is cut on a word or line boundary, for the same reason the digest sheds whole items rather than trimming characters: text that stops mid-word reads as corrupted. When it is clipped it says where the rest is. This is what content-hash dedup structurally cannot catch. `compact` merges notes whose content is identical; two notes making one claim in different words are not identical, only synonymous, and no amount of compaction repairs that later. Not built, deliberately: `write --dry-run`. It would turn one call into two, and `brief` already answers "what is already here" before composing — which is the same question, asked earlier and cheaper. 111 tests, up from 109. Zero dependencies. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014fSLBRUVVhAauWDuzJM4mc
|
Warning Review limit reachedNext included review available in 37 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The last piece of the capture pipeline, and the one that survived contact with
brief.The problem
A title collision reported the other note's id and stopped:
Deciding what to do with that — merge a duplicate, supersede a changed claim, or link a genuine contradiction — needs the other note's words. Getting them meant a second
agent-memory get. On a biller that charges per prompt rather than per tool call, that is another request for somethingwritealready had in hand.Now
Fixed in the turn that found it.
--jsongains acollisionsarray withexisting,existingType,existingTitle,existingArchived,excerpt,truncated.One extra row is read, and only when a collision actually occurred — bodies are still not loaded for the whole store to describe the one that collided.
The excerpt is cut on a word or line boundary, for the same reason the digest sheds whole items rather than trimming characters: text that stops mid-word reads as corrupted. When clipped, it says where the rest is:
Why this matters more than it looks
This is precisely what content-hash dedup cannot catch.
compactmerges notes whose content is identical; two notes making one claim in different words are not identical, only synonymous. No amount of later compaction repairs that — the moment to catch it is the write.Not built, deliberately
write --dry-runwas on the Tier 3 list. It would turn one call into two, andbriefalready answers "what is already here" before composing — the same question, asked earlier and cheaper. Adding it would have made the turn economics worse, not better.Verification
skills/remember/SKILL.mdupdated: decide in this turn, do not rungetfor what you were handed🤖 Generated with Claude Code
https://claude.ai/code/session_014fSLBRUVVhAauWDuzJM4mc