Background agent should wait for start command to finish in environment.json

Feature request for product/service

Background Agent (GitHub, Slack, Linear,…)

Describe the request

Hi,

I’ve noticed that the background agent doesn’t wait for the start command to finish executing before the AI chat starts running. This can cause problems if you want to include a database to run e2e tests after changing code and you need to seed it and it takes a while. I though the terminals would start after the start command but they all get executed immediately and the AI starts working immediately as well it seems. I checked adding && sleep 300 at the end of my start command and saw the AI starting in less than 5mins.

I’d like the start command to be synchronous and only start terminals after it ended. That way, I can seed my local database dynamically based on the latest code without needing to update the database manually and take a new snapshot every time. I’m assuming you’re putting all these commands somewhere in EC2 snapshot user data.

Thank you.

One workaround for this particular use case is adding seeding right before the frontend e2e tests. That way, you get the most up to date seeds, including the changes AI may have made to seeds, and you’re sure you get a seeded database when it matters.