Relationships
#3062 Workflow load errors print the raw Zod issue dump instead of a readable message
Opened by skunk-ape · 10/6/2026
Description
When a workflow YAML fails schema validation, the error that reaches the user is the raw ZodError message. In Zod 4 that is the JSON array of issues, so a single bad field prints as a multi-line dump with origin, code, path and message keys, and any custom message on the field is buried inside it.
The load path never formats the error: yaml_workflow_repository.ts calls Workflow.fromData and rethrows anything that is not NotFound, and broken_workflow.ts forwards error.message as the broken reason. swamp workflow create, validate, run and the serve upload handler all inherit this.
Expected
A one-line message per issue with its path, for example: Step name at [HOST-1] must not contain control characters. Zod 4 ships z.prettifyError for exactly this. The extension kind adapters already format their ZodErrors (formatValidationError in src/domain/extensions/kind_adapter.ts), so workflows are the odd one out.
Suggested fix
Catch ZodError at the workflow load boundary (Workflow.fromData, or the repository and broken-workflow lister) and raise a domain error whose message is z.prettifyError(error), with the workflow file named. Keep the JSON mode payload structured.
Found while planning swamp-club#3027, which adds a regex rule on step and job names whose custom message is currently only visible inside the dump.
Open
No activity in this phase yet.
system commented 10/6/2026, 12:14:11 PM
Classified automatically when this issue was filed.
- Type: Bug
If you feel this classification is incorrect, add a ripple to tell us so.
Sign in to post a ripple.