Fix deploy tests crashing under AI coding assistants (#93394)
The Vercel CLI bundles `@vercel/detect-agent`, which inspects environment variables that AI coding assistants (Claude Code, Cursor, Codex, Gemini CLI, GitHub Copilot CLI, and others) set in every shell they spawn. When the CLI detects one, `vercel deploy` writes a JSON payload to stdout instead of the plain deployment URL. The harness then crashes when `new URL(deployRes.stdout)` in `next-deploy.ts` runs, which breaks every `test-deploy*` run launched from such a shell. The fix appends `--non-interactive=false` to `vercelFlags` so it is passed to both `vercel link` and `vercel deploy`. The CLI honors that flag as an explicit override of the agent-derived default, and the deploy command's JSON-vs-plain output decision is gated on `client.nonInteractive` (`const asJson = formatResult.jsonOutput || client.nonInteractive` in the deploy source), so a single flag is enough to restore plain-URL stdout. The alternative considered was reading `deployment.url` out of the JSON payload at the single call site that breaks. That is a more localized change but couples the harness to an undocumented payload shape that exists only for AI agents, so a future rename of that field would silently break deploy tests again. Forcing the CLI's output mode avoids that coupling, which is why the flag won. With this change, `pnpm test-deploy` and `pnpm test-deploy-turbo` work uniformly whether they are launched from a human's interactive terminal or from inside an AI coding assistant.
Showing
Please
register
or
sign in
to comment