Here’s what we just built:
The Deploy Verification Agent — Phase 1
Currently when FocusCloud deploys an app, it just sets up nginx and returns the URL. It never checks if the app actually works. The most common failure is the double-route-prefix bug we kept fixing manually — /api/tasks/tasks instead of /api/tasks.
The agent runs automatically after every deploy and does 4 things:
1. Wait for the app to come online Polls the deployed URL for up to 10 seconds. If the app never responds, flags it immediately.
2. Check API endpoints For each route file in server/routes/ it hits https://subdomain.focuscloud.dev/api/resource . If it gets back HTML instead of JSON, that’s the route mounting bug — the Express static file server is intercepting the request before the API route handles it.
3. Auto-fix route mounting issues If it finds the bug, it reads each route file and removes the doubled prefix. For example:
router.get('/tasks', ...)mounted at/api/tasks→ becomesrouter.get('/', ...)router.delete('/tasks/:id', ...)→ becomesrouter.delete('/:id', ...)
4. Rebuild and redeploy After patching the route files, it rebuilds the app inside the sandbox and redeploys. The user never sees any of this — they just get a working URL.
What it doesn’t do yet (Phase 2 & 3):
- Catch JS runtime errors in the frontend (blank page bugs)
- Run smoke tests (actually POST/GET data)
- Fix TypeScript errors found post-deploy
- Handle database connection failures
Why non-fatal: The whole agent is wrapped in try/catch. If the agent itself crashes for any reason, the deploy still succeeds — the agent is additive, never blocking.
Build succeeded?