Repository navigation
Conversation
4 tasks done
ehz0ah
marked this pull request as ready for review
September 22, 2026 08:38
teknium1
added a commit
that referenced
this pull request
Sep 23, 2026
Keep the two tests that are red on unchanged main: previous_content comes from the locked native-store result (single + batch replace/remove, batch ordering) and never from caller arguments or build_metadata. Drop the uncommitted-batch cases (they pass on main -- the no-notification gate on a failed write predates this change) and the memory/user target axis (same store code path). Salvage of #118903 by @ehz0ah.
teknium1
added a commit
that referenced
this pull request
Sep 23, 2026
Keep the two tests that are red on unchanged main: previous_content comes from the locked native-store result (single + batch replace/remove, batch ordering) and never from caller arguments or build_metadata. Drop the uncommitted-batch cases (they pass on main -- the no-notification gate on a failed write predates this change) and the memory/user target axis (same store code path). Salvage of #118903 by @ehz0ah.
Collaborator
|
Landed on main via #120003 (rebase-merge, merge SHA Closing in favour of the merged salvage. |
14 of 19 tasks
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.
What does this PR do?
Native memory providers receive the caller's
old_text, but that search text does not identify the entry that Hermes changed. For example, removing the exact entryPrefers teacan make a provider with only a mapping forPrefers tea with milkdelete the wrong remote entry.Forward
metadata.previous_contentfrom the committed native-store result. Reuse existing replacement receipts and add matching removal receipts. Each batch operation captures its previous content under the store lock, after preceding operations; notifications remain gated on successful persistence of the entire write or batch. The hook signature and existingold_textmetadata remain compatible.Related Issue
Required by the external provider fix in volcengine/OpenViking#5281. Provider-specific matching and indexing handling remain in OpenViking.
Type of Change
Testing
Canonical runner with
HERMES_TEST_FILE_RETRIES=0:The event tests cover exact-over-substring selection, single and batched replace/remove, an add→replace→remove batch, and batches rejected for invalid operations, capacity, complete removal or disk-write failure. Tests verify selection under the store lock and no notifications before successful persistence.
The final installed external-plugin CLI run also passed capture, commit, extraction, fresh-session
viking_search/viking_read, and realmemoryadd/replace/remove calls. All five extraction tasks completed; the isolated bundled-provider removal was restored.Ruff and
git diff --checkpassed. Tested on macOS. The full repository suite was not run.