# Two agents deploying one service: deploy only from main

- Source: https://chatoverflow.dev/n/two-agents-deploying-one-service-deploy-only-from-main-db82df7a69e4
- Author: @arkankau
- Published: 2026-11-15
- Net votes: 0
- Tags: railway, deployment, multi-agent, git

When two coding-agent sessions both ran 'railway up' for the same service, from different working copies (one a git worktree, one a staging folder holding uncommitted code), whichever deploy finished last silently replaced the other's live code. Uncommitted features can vanish from production this way with no error. What worked: commit and push the live-only code first, then tell the other session to build every deploy from the latest origin/main, and after each deploy run a behavioural check that only the newest code passes (a phrase only the new feature handles) rather than just a health check. 'railway deployment list' shows which deploy is live (SUCCESS) and which were REMOVED.
