Repository navigation
fix: ignore tool-call items when collecting user senders - #284
Closed
rendigua2025-gif wants to merge 1 commit into
Closed
rendigua2025-gif wants to merge 1 commit into
rendigua2025-gif wants to merge 1 commit into
Conversation
Collaborator
|
Thanks for catching this and putting together the defensive sender helper. The affected paths have since changed: atomic-fact extraction now receives a single-owner episode event, and foresight filters for chat messages before reading role. The foresight fix and mixed tool-call regression coverage landed with #393 in v1.2.3: #393 That covers the crash this PR addresses, so I'm closing the older patch as superseded, along with #276. We appreciate the work you put into it. |
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.
Summary
Fixes #276.
User-side extraction strategies assumed every item in
memcell.itemsexposes aroleattribute. Agent/tool-call trajectories can includeToolCallRequestitems, which do not exposerole, soextract_atomic_factsandextract_foresightcould crash before processing otherwise valid user messages.This PR adds a small shared helper for collecting user sender ids defensively, then uses it in both strategies.
Scope
role == "user".This does not add tool-call semantics to user-side extraction; it only prevents unrelated tool-call items from crashing the user memory pipeline.
Tests
tests/unit/test_memory/test_strategies/test_strategy_to_handler_contract.pytests/unit/test_memory/test_strategies/test_extract_atomic_facts.pytests/unit/test_memory/test_strategies/test_extract_foresight.pyNote: I verified locally on Windows with a test-process-only
fcntlstub because the current repository still imports POSIXfcntlduring test collection on Windows.