Conversation
Collaborator
|
Closing: the bundled Hindsight provider this PR patches has moved out of this repo. Thanks @zhuxiucai for this contribution. In #119888 (merge Triage notes:
If you believe this was closed in error, comment and we will reopen. (Bulk-closed in the hindsight-move close pass.) |
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?
Hermes currently serializes each retained user/assistant pair as a JSON array and then wraps buffered pairs in another array, producing
[[user, assistant], ...].Hindsight's structured conversation chunker and append-array merge both expect one flat JSON array of message objects. The nested payload therefore falls back to plain-text chunking; after multiple appends, the stored document can become newline-concatenated JSON arrays instead of one valid conversation.
This change keeps buffered pairs structured in memory and flattens them only when serializing the retain payload. Both normal retain dispatch and flush-on-session-switch now send
[user, assistant, ...].Related Issue
No matching issue or PR found after searching the repository.
Type of Change
Changes Made
plugins/memory/hindsight/__init__.pytests/plugins/memory/test_hindsight_provider.pyHow to Test
scripts/run_tests.sh tests/plugins/memory/test_hindsight_provider.py -q— 85 tests pass.scripts/run_tests.sh tests/plugins/memory/ -q— 363 tests pass across 24 files.update_mode="append"; read the stored document and verify it parses as four flat message objects inuser, assistant, user, assistantorder. Recall the synthetic facts, then delete the canary bank.Checklist
Code
fix(scope):,feat(scope):, etc.)scripts/run_tests.shwrapper and all relevant tests passDocumentation & Housekeeping
cli-config.yaml.exampleupdate — N/A; no config keys changedCONTRIBUTING.md/AGENTS.mdupdate — N/A; no architecture or workflow changedScreenshots / Logs
Real canary verification: