Fix ThreadContextResponse messages attribute bug in zep-autogen - #412
Closed
jackaldenryan wants to merge 1 commit into
Closed
jackaldenryan wants to merge 1 commit into
jackaldenryan wants to merge 1 commit into
Conversation
The ThreadContextResponse object returned by thread.get_user_context() does not have a 'messages' attribute, causing AttributeError in update_context() method. This fix: - Removes incorrect assumption about memory_result.messages - Adds separate API call to thread.get() to retrieve recent messages - Wraps message retrieval in try/catch to handle errors gracefully - Maintains backward compatibility while fixing the integration Fixes memory persistence issues where ZepMemory could store messages but failed to inject context due to this API compatibility bug.
Collaborator
|
Closing as fixed in #416 |
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.
Problem
The
zep-autogenlibrary'supdate_context()method has a bug where it tries to accessmemory_result.messageson aThreadContextResponseobject, but this attribute doesn't exist in the current Zep Cloud API.Error encountered:
Root Cause
The
ThreadContextResponseobject returned bythread.get_user_context()only contains acontextfield, not amessagesfield. The library was likely written when this attribute existed but the API has since changed.Solution
This PR fixes the bug by:
memory_result.messagesthread.get()to retrieve recent messages properlyChanges Made
src/zep_autogen/memory.pylines 258-265ThreadContextResponse.messagesexistedImpact
This fixes memory persistence issues where:
update_context()callsTesting
This should resolve issues where AutoGen agents with ZepMemory appeared to work but couldn't actually access previous conversation context.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com