test(minimax): use 'content' key so compress_history_tags actually runs#92
Open
shaun0927 wants to merge 1 commit intolsdefine:mainfrom
Open
test(minimax): use 'content' key so compress_history_tags actually runs#92shaun0927 wants to merge 1 commit intolsdefine:mainfrom
shaun0927 wants to merge 1 commit intolsdefine:mainfrom
Conversation
test_think_tag_compressed_in_old_messages constructed messages with a 'prompt' key, but compress_history_tags in llmcore.py reads msg['content']. The test therefore raises KeyError on the first iteration of the compression loop before any tag-handling logic runs, so the assertion line is never reached. Replace 'prompt' with 'content' in the fixture and in the post- compression lookup so the test exercises the actual code path.
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
tests/test_minimax.py::TestMiniMaxCompressHistoryTags::test_think_tag_compressed_in_old_messagesconstructs its message fixture with the key
\"prompt\":But
compress_history_tagsinllmcore.pyreadsmsg['content']:So the function raises
KeyError: 'content'on the first iteration of thecompression loop. The assertion line that the test was written to exercise
is never reached.
Fix
Replace
\"prompt\"with\"content\"in the fixture and in thepost-compression lookup so the test actually runs the compression
code path it claims to verify.
Verification
The test now exercises the real
<think>tag truncation path againstcompress_history_tags, which is what the test name promises.