Add a global JSON error envelope with stable codes and next_steps#1282
Conversation
… error envelope.
Workflow commands (create, cutover, cancel, switch-traffic, etc.) now return
status/issues/next_steps JSON with contextual remediation commands in --format
json mode. Unhandled errors on any command now fall back to a classified
{status, code, error, next_steps} envelope on stdout instead of a bare
{"error"} blob on stderr.
Co-authored-by: Cursor <cursoragent@cursor.com>
…ommands. Auth failures (expired token, not authenticated) surfaced through workflow subcommands now report NO_AUTH with login next_steps instead of a generic WORKFLOW_ERROR, matching the remediation agents get on any other command. Co-authored-by: Cursor <cursoragent@cursor.com>
A bare "timeout" substring match swallowed operation and deadline timeouts (e.g. workflow cutover timeouts), giving agents connectivity remediation instead of command-specific next_steps. Match specific transport error strings (i/o timeout, TLS handshake timeout, connection refused/reset, no such host) instead. Co-authored-by: Cursor <cursoragent@cursor.com>
…mmands The JSON confirmation envelope replaced the old Format() != Human guard, which let --format csv fall through to interactive confirmation on a TTY for cancel, cutover, and switch-traffic. Reinstate the format error after the JSON branch so non-JSON machine formats fail fast without --force. Co-authored-by: Cursor <cursoragent@cursor.com>
…nvelope. Co-authored-by: Cursor <cursoragent@cursor.com>
…ument codes. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b7ce77a. Configure here.
…_REQUIRED. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…N_COMMAND." This reverts commit 8220ab3.
|
Current version of PR was reviewed by /review-bugbot on Jul 8, 20:20. It flagged 2 findings. Show 2 findings1. SQL errors always COMMAND_FAILED
The SQL JSON error path now always sets 2. AUTH_INVALID never emitted globally
Bugbot on commit |

Summary
--format jsonmode now print a single structured envelope on stdout:status,error,issues: [{code, message}],next_steps, matching the schema used byauth check,sql, andimport d1NO_AUTH,NOT_FOUND,CONFIRMATION_REQUIRED,NETWORK_ERROR,INVALID_USAGE, ...) with remediation commands innext_stepsAGENTS.mdagent guideTest plan
go test ./internal/...pscale database list --org <bogus> --format jsonreturns the NOT_FOUND envelope with discovery next_steps