Fix/tool example to messages output mismatch - #39160
Closed
eslam-ahmed43 wants to merge 2 commits into
Closed
Conversation
InMemoryRecordManager.update() was calling get_time() inside the loop once per key, causing timestamp drift across large batches. This made list_keys(before=...) miss stale documents during full/incremental cleanup, resulting in fewer deletions than expected (see langchain-ai#39087). Fixes langchain-ai#39087
…calls in tool_example_to_messages
Contributor
|
This PR has been automatically closed because you are not assigned to the linked issue. Opening a PR before assignment is discouraged and is not an indication that it will be accepted. This process exists so maintainers can confirm a change is aligned with the project direction before contributors invest time implementing it. Please:
Maintainers: reopen this PR or remove the |
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
tool_example_to_messagessilently truncates tool outputs when the number oftool_outputsdoes not match the number oftool_calls, because ofzip(..., strict=False).A user passing mismatched outputs gets no error and loses data without knowing.
Closes #39138
Solution
Added a length check before the
zipthat raises a clearValueErrorwhentool_outputsis provided but its length does not matchtool_calls.Tests
ValueErrorwith a descriptive messagetool_outputsprovided inserts placeholder as before