Agent mode terminal not working

After the agent makes a change I have a rule that the agent must run my program so it can monitor the terminal output. I’m running a flask application so it will just do python main.py in the terminal. When it tries to run the command the terminal doesn’t do anything. It just spins like its waiting and will stay there until I stop it. I notice in new composers it will work the first few times but then it will stop working. I will tell the ai this is happening then it might fix it or not. But if it does fix it, it will only fix that time and will stop working the next time.

I’ve probably used over 100 credits in the past few days just by telling composer that its not showing anything in the terminal. And I cant just keep creating new composers, its inefficient.

Can anyone help?