Skip to content

Error executing memory callback for task X #307

@azulaaGy

Description

@azulaaGy

i'm getting this error

[14:05:06] ERROR    [14:05:06] **agents.py:633 ERROR Error executing memory callback for task 0: There is no current event loop in thread      agents.py:633**
                    'ScriptRunner.scriptThread'.
C:\Users\david\AppData\Local\Programs\Python\Python313\Lib\site-packages\rich\text.py:144: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x00000265F93F84F0>
  def __init__(
ResourceWarning: Enable tracemalloc to get the object allocation traceback
           ERROR    [14:05:06] agents.py:634 ERROR There is no current event loop in thread 'ScriptRunner.scriptThread'.                     agents.py:634
                    ╭───────────────────────────────────────── Traceback (most recent call last)───────────────╮ 
                    │ C:\Users\david\AppData\Local\Programs\Python\Python313\Lib\site-packages\praisonaiagents\agents\agents.py:626 inrun_task                                                                                                                                                                                        
                    │                                                                                                                                                                                                       
                    │   623 │   │   │   │   │   task.status = "completed"624 │   │   │   │   │   # Run execute_callback for memory operations                                                                                      625 │   │   │   │   │   try:                                                                                                                                                            
                    │ ❱ 626 │   │   │   │   │   │   if asyncio.get_event_loop().is_running():                                                                                                      
                    │   627 │   │   │   │   │   │   │   asyncio.create_task(task.execute_callback(task_output))                                                               
                    │   628 │   │   │   │   │   │   else:                                                                                                                                                     
                    │   629 │   │   │   │   │   │   │   loop = asyncio.new_event_loop()                                                                                                  
                    │                                                                                                                                                                                                      
                    │ C:\Users\david\AppData\Local\Programs\Python\Python313\Lib\asyncio\events.py:716 in get_event_loop                            
                    │                                                                                                                                                                                                      
                    │   713 │   │   │   self.set_event_loop(self.new_event_loop())                                                                                                          
                    │   714 │   │                                                                                                                                                                                     
                    │   715 │   │   if self._local._loop is None:                                                                                                                                       
                    │ ❱ 716 │   │   │   raise RuntimeError('There is no current event loop in thread %r.'717 │   │   │   │   │   │   │      % threading.current_thread().name)                                                                                           
                    │   718 │   │                                                                                                                                                                                     
                    │   719 │   │   return self._local._loop                                                                                                                                              
                    ╰───────────────────────────────────────────────────────────────────────────╯ 
                    RuntimeError: There is no current event loop in thread 'ScriptRunner.scriptThread'.

for python 3.13. i tried running the same code with python 3.10 and the error is the same except i'm also getting this warning despite praisonaiagents[memory] already being installed:

WARNING  [12:47:21] memory.py:18 WARNING To use memory features, please run: pip install "praisonaiagents[memory]"    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions