SIGKILL and memory errors on calling result.stream_events()

from agents import Runner, TResponseInputItem

result = Runner.run_streamed(
                agent,
                conversation_history,
                context=context,
                max_turns=MAX_TURNS,
            )

async for event in result.stream_events():

The last line just throws a SIGKILL while running this script as a part of a firebase emulator locally. Currently this happens 8/10 times

The packages being used are:
openai==1.75.0
openai-agents==0.0.11

Has anybody experienced this before in python/has the fix for it? Any guidance would be appreciated

The exact error:

Request to function failed: Error: socket hang up
>  [2025-05-09 00:31:07 +0000] [34146] [ERROR] Worker (pid:34147) was sent SIGKILL! Perhaps out of memory?
1 Like