Add RunnableWithMessageHistory deserialization repro and ignore local…#2568
Open
haripriyarao26 wants to merge 4 commits intoopenai:mainfrom
Open
Add RunnableWithMessageHistory deserialization repro and ignore local…#2568haripriyarao26 wants to merge 4 commits intoopenai:mainfrom
haripriyarao26 wants to merge 4 commits intoopenai:mainfrom
Conversation
… clone repro_36380.py demonstrates constructor-shaped output dicts and safe persistence after langchain_core uses an explicit message allowlist. Ignore .langchain-src/ and .venv-lc/ for local LangChain development. Made-with: Cursor
- Match issue payload (dumps + json.loads) and question/output keys - Document .venv-lc and link to issue; add Made-with: Cursor - Add repro_36380_PULL_REQUEST.md for copy-paste GitHub PR description
29 tasks
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f64d96485
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
- Add topic-scoped requirements.txt for langchain-core - Resolve repo root via AGENTS.md so .langchain-src stays at repo root - Update PR template and .gitignore comment Made-with: Cursor
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.
Description:
This PR addresses issue #36380 where RunnableWithMessageHistory unintentionally revives "constructor-shaped" data from run.outputs into live objects (history poisoning).
Changes:
Restricted deserialization in RunnableWithMessageHistory to ensure outputs are treated as inert data unless they match authorized types.
Added a reproduction script verification.
Issue:
Fixes #36380
Checklist:
[x] My code follows the style guidelines of this project.
[x] I have performed a self-review of my own code.
[x] I have commented my code, particularly in hard-to-understand areas.