Repository navigation
Conversation
|
yunyv please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
This branch was successfully deployed
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.
Motivation and Context
make_hashableconverts sets to tuples in their iteration order. Equal sets need not have the same iteration order, so equalFunctionResultContentandChatMessageContentinstances can have different hashes. For example, results constructed fromset([0, 8])andset([8, 0])compare equal but do not deduplicate in a set.This also affects
ChatHistoryChannel.invoke: when an agent records a message in history and returns an equal message with an equivalently valued set, the channel'smutated_historymembership check can miss it and append/yield the same result twice. A regression test exercises that actual channel path using a local agent double; no model service is called.This was found through source inspection and local reproduction, not a reported production incident. No matching open issue or competing PR was found. The contribution guide allows skipping an issue for trivial changes.
Description
Validation
Python 3.12.14, using the actual SDK and installed dependencies:
hashing.pywith the repository config and skipped imported modules: passed. This is not a whole-SDK type check.git diff --check: passed.hashing.pybytes match the tested source.An earlier broader run had two Azure client initialization failures because the environment lacked the optional SOCKS transport dependency. Installing
socksioresolved both; network or proxy settings were not changed.The full repository suite, other Python versions and live provider/model integration tests were not run. This does not attempt to change dictionary-key handling or every possible custom-object hashing behavior.
AI assistance was used for investigation, implementation and testing. A separate automated review ran 15 additional cases: baseline 10 failed and 5 passed; patched 15 passed. No human review is claimed.
Contribution Checklist