diff --git a/backend/run_agent_background.py b/backend/run_agent_background.py index 2c3dcd48..cf9715b9 100644 --- a/backend/run_agent_background.py +++ b/backend/run_agent_background.py @@ -135,8 +135,8 @@ async def run_agent_background( # Store response in Redis list and publish notification response_json = json.dumps(response) - pending_redis_operations.append(redis.rpush(response_list_key, response_json)) - pending_redis_operations.append(redis.publish(response_channel, "new")) + pending_redis_operations.append(asyncio.create_task(redis.rpush(response_list_key, response_json))) + pending_redis_operations.append(asyncio.create_task(redis.publish(response_channel, "new"))) total_responses += 1 # Check for agent-signaled completion or error