fix: #2776 keep private tool metadata out of persisted session items#2781
Merged
fix: #2776 keep private tool metadata out of persisted session items#2781
Conversation
c5b7c28 to
cf69e10
Compare
cf69e10 to
ccf6e99
Compare
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.
This pull request fixes #2776
ToolCallItemmetadata handling so private_agents_*fields are never written into persisted session history. Tool-calldescriptionandtitlestill exist on in-memory run items and inRunState, but persisted session transcripts now remain validTResponseInputItems that can be replayed directly or shared across SDK versions without introducing unsupported tool-call fields.The change keeps defensive read-side sanitization in place for session replay and OpenAI responses compaction. That means stale or externally written
_agents_*keys are stripped before model calls, fingerprinting, andresponses.compact(input=...), while normal session persistence now stores only API-valid tool-call payloads. Additional regression coverage checks the directto_input_item()surface, the run-item replay path, session persistence, session replay, and both uncached and cached compaction-input flows.