Skip to main content
← Back to list
01Issue
BugClosedSwamp CLI
Assigneesstack72

Relationships

#1063 workflow validate treats defaulted model-method inputs as required (validate fails, run succeeds)

Opened by catjen · 7/10/2026

Description

swamp workflow validate fails a model_method step with "Missing required inputs: ..." for every model-method argument that has a zod .default(...) - even though swamp workflow run (and swamp model method run) apply those defaults fine. The root cause appears to be the zod-to-JSON-schema conversion: defaulted fields are emitted with a default AND listed in the schema's required array (visible in swamp model create --json output), and the validator trusts required.

The result: to make validate pass, every workflow step must restate all defaulted inputs, defeating the point of model-side defaults.

Steps to reproduce

  1. An extension model whose method arguments schema is e.g.
arguments: z.object({
  periodDir: z.string().min(1),
  dryRun: z.boolean().default(false),
  psExe: z.string().default("powershell"),
})
  1. A workflow step providing only the truly-required input:
task:
  type: model_method
  modelIdOrName: my-model
  methodName: sync
  inputs:
    periodDir: ${{ inputs.periodDir }}
  1. swamp workflow validate my-workflow --json -> "Missing required inputs: dryRun, psExe", passed: false.
  2. swamp workflow run my-workflow --input periodDir=X -> succeeds; defaults applied at runtime.

Expected

Validation treats defaulted arguments as optional (or the generated JSON schema stops listing defaulted fields under required), so validate and run agree.

Actual

validate fails / run succeeds - the two disagree about the same workflow.

Environment

swamp 20260710.093422.0-sha.05ac9e7f, Windows 11 x64.

02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED+ 1 MOREASSIGNEDCLASSIFICATION

Closed

7/10/2026, 6:18:38 PM

No activity in this phase yet.

03Sludge Pulse
stack72 assigned stack727/10/2026, 5:54:37 PM
Editable. Press Enter to edit.

stack72 commented 7/10/2026, 6:18:37 PM

Hey @catjen — thanks for the detailed report, the repro steps and schema example made this easy to trace.

This matches swamp-club#617, which we fixed in PR #1563 (June 11). The fix post-processes z.toJSONSchema() output to strip fields with a default value from the required array, so the validator and runtime now agree. We verified the fix against your exact schema pattern (z.boolean().default(false), z.string().default("powershell")) and workflow validate passes correctly on current builds.

One thing we couldn't explain: your build SHA (05ac9e7f) doesn't appear in our commit history. Could you let us know where that binary came from — self-compiled from a fork, a third-party distribution, a pinned release channel? That would help us understand why the fix isn't reaching you and whether there's a distribution path we need to look at.

Thanks!

Sign in to post a ripple.