Skip to content

Preserve raw API error codes in JSON agent output - #1315

Merged
mscoutermarsh merged 1 commit into
mainfrom
mike/preserve-schema-mutation-blocked-api-code
Jul 29, 2026
Merged

Preserve raw API error codes in JSON agent output#1315
mscoutermarsh merged 1 commit into
mainfrom
mike/preserve-schema-mutation-blocked-api-code

Conversation

@mscoutermarsh

Copy link
Copy Markdown
Member

Summary

  • Retain the raw API {code, message} code on planetscale.Error as APICode.
  • GlobalJSONError emits that code in issues[0].code (exact schema_mutation_blocked) instead of collapsing unknown API failures to COMMAND_FAILED.
  • schema_mutation_blocked gets actionable next steps (wait/retry) rather than auth troubleshooting.

Test plan

  • go test ./internal/planetscale/ ./internal/cmdutil/
  • make lint
  • After release: pscale branch vtctld move-tables create ... --format json while a marker is active shows "code":"schema_mutation_blocked" in the JSON envelope

Made with Cursor

Keep schema_mutation_blocked (and other API codes) on planetscale.Error
and surface them in GlobalJSONError instead of collapsing to COMMAND_FAILED.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mscoutermarsh
mscoutermarsh requested a review from a team as a code owner July 29, 2026 20:21
@mscoutermarsh
mscoutermarsh merged commit 39d6a43 into main Jul 29, 2026
4 checks passed
@mscoutermarsh
mscoutermarsh deleted the mike/preserve-schema-mutation-blocked-api-code branch July 29, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants