def test_follow_up_instructions_dynamic_behavior(self):
        """Test that follow-up instructions change correctly based on turn count and max setting"""
        # Test with default MAX_CONVERSATION_TURNS
        max_turns = MAX_CONVERSATION_TURNS

        # Test early conversation (should allow follow-ups)
        early_instructions = get_follow_up_instructions(0, max_turns)
        assert "CONVERSATION THREADING" in early_instructions
        assert f"({max_turns - 1} exchanges remaining)" in early_instructions

        # Test mid conversation
        mid_instructions = get_follow_up_instructions(2, max_turns)
        assert "CONVERSATION THREADING" in mid_instructions
        assert f"({max_turns - 3} exchanges remaining)" in mid_instructions

        # Test approaching limit (should stop follow-ups)
        limit_instructions = get_follow_up_instructions(max_turns - 1, max_turns)
        assert "Do NOT include any follow-up questions" in limit_instructions
        assert "FOLLOW-UP CONVERSATIONS" not in limit_instructions

        # Test at limit
        at_limit_instructions = get_follow_up_instructions(max_turns, max_turns)
        assert "Do NOT include any follow-up questions" in at_limit_instructions

        # Test with custom max_turns to ensure dynamic behavior
        custom_max = 3
        custom_early = get_follow_up_instructions(0, custom_max)
        assert f"({custom_max - 1} exchanges remaining)" in custom_early

        custom_limit = get_follow_up_instructions(custom_max - 1, custom_max)
        assert "Do NOT include any follow-up questions" in custom_limit
Test that follow-up instructions change correctly based on turn count and max setting
tests/test_conversation_memory.py