Hi! I just pulled the latest changes from origin/main (commit 4d3d177) and ran into a test failure when running the quality checks. Spent a bit debugging this and found an interesting config mismatch.
Description
The test tests/test_conversation_memory.py::TestConversationMemory::test_add_turn_max_limit fails when .env contains MAX_CONVERSATION_TURNS=40 (which comes from .env.example).
Root Cause
Turns out there's a mismatch between the code default (50 in utils/conversation_memory.py:122) and what .env.example sets (40). The test uses the runtime value from .env, so it creates 40 turns and expects add_turn() to reject adding one more—but the check len(context.turns) >= MAX_CONVERSATION_TURNS (40 >= 40) should catch this, yet it doesn't seem to.
Failure Details
FAILED tests/test_conversation_memory.py::TestConversationMemory::test_add_turn_max_limit - assert True is False
Steps to Reproduce
- Make sure
.env has MAX_CONVERSATION_TURNS=40 (default from .env.example)
- Run:
python -m pytest tests/test_conversation_memory.py::TestConversationMemory::test_add_turn_max_limit -v
- Test fails
Workaround
Setting MAX_CONVERSATION_TURNS=50 in .env makes the test pass.
Suggested Fix
A few options to fix this:
- Update
.env.example to MAX_CONVERSATION_TURNS=50 (align with code default)
- Or update the code default to 40 (align with
.env.example)
- Alternatively, make the test explicitly set
MAX_CONVERSATION_TURNS=50 via @patch.dict
Environment
- Python: 3.12.11
- pytest: 9.0.1
- Git commit: 4d3d177 (latest from origin/main)
Hi! I just pulled the latest changes from origin/main (commit 4d3d177) and ran into a test failure when running the quality checks. Spent a bit debugging this and found an interesting config mismatch.
Description
The test
tests/test_conversation_memory.py::TestConversationMemory::test_add_turn_max_limitfails when.envcontainsMAX_CONVERSATION_TURNS=40(which comes from.env.example).Root Cause
Turns out there's a mismatch between the code default (50 in
utils/conversation_memory.py:122) and what.env.examplesets (40). The test uses the runtime value from.env, so it creates 40 turns and expectsadd_turn()to reject adding one more—but the checklen(context.turns) >= MAX_CONVERSATION_TURNS(40 >= 40) should catch this, yet it doesn't seem to.Failure Details
Steps to Reproduce
.envhasMAX_CONVERSATION_TURNS=40(default from.env.example)python -m pytest tests/test_conversation_memory.py::TestConversationMemory::test_add_turn_max_limit -vWorkaround
Setting
MAX_CONVERSATION_TURNS=50in.envmakes the test pass.Suggested Fix
A few options to fix this:
.env.exampletoMAX_CONVERSATION_TURNS=50(align with code default).env.example)MAX_CONVERSATION_TURNS=50via@patch.dictEnvironment