fix(workflows): accept json input type and return 400 for unsupported input types
Merged
WA
6d ago+217+217+012345678901234567890123456789-18-18-01234567890123456789
Summary
- A Start/API trigger input field typed
json(the type name blocks and outputs use for objects) made manual/v2/copilot runs fail with a 500 and broke MCP schema generation on deploy: the shared run schema threw a plainErroron any type outside its list jsonis now an alias ofobjectandfilesoffile[], resolved through one helper (canonicalInputFormatFieldType) ininput-format-schema.tsthat the run schema, the executor'scoerceValue, andisFileFieldTypeall use. The editor's enum is built from the same list- Reserved input names and still-unsupported types now throw
OrchestrationError('validation'), so every caller of the shared schema returns a 400 naming the field and the allowed types instead of a 500 - The editing validator (operations and v2 state replace) now rewrites
json/filesrows ininput-formatsub-blocks to their canonical type and rejects unknown types with the allowed list. Thetablecase is unchanged
Type of Change
- Bug fix
Testing
- Regression tests in
input-schema.test.ts,editing/validation.test.ts,start-block.test.ts: all 5 new or changed cases fail on the pre-fix source and pass with the fix - Ran 6 test files (
input-schema,editing/validation,start-block,mcp/workflow-tool-schema,input-format,triggers/run-options): 165 tests pass bun run lint,check:comment-hygiene,check:unused-exports,check:boundaries,check:client-boundary,check:utils,check:test-patterns,check:source-conventions, and the block-registry check all pass- I did not run type-check,
check:audits, or the full test suite locally. CI runs all three
Checklist
- Code follows project style guidelines
- Self-reviewed my changes
- Tests added/updated and passing (new tests pass the
test-auditauthoring gate) - No new warnings introduced
- I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)