Source: PR #266 "Known follow-ups":
Type strictness: weak models (glm) return JSON types as strings ("42", an array as a string). Strict schema validation rejects these even after retries — needs lenient coercion in the StructuredOutput validator.
Impact: Workflow agent(..., {schema}) calls against weaker providers burn all schema-repair retries on type mismatches that are trivially coercible ("42" → 42, "true" → true, JSON-encoded-string arrays → arrays), then fail the stage. This makes the workflow engine effectively Anthropic/OpenAI-only for structured stages.
Fix sketch: Before strict validation, run a lenient pre-pass keyed on the schema: coerce numeric/boolean strings where the schema expects number/integer/boolean, and json.loads string values where the schema expects array/object. Only fall back to the schema-repair retry loop if coercion still fails. Add fixtures from real glm outputs.
Source: PR #266 "Known follow-ups":
Impact: Workflow
agent(..., {schema})calls against weaker providers burn all schema-repair retries on type mismatches that are trivially coercible ("42"→42,"true"→true, JSON-encoded-string arrays → arrays), then fail the stage. This makes the workflow engine effectively Anthropic/OpenAI-only for structured stages.Fix sketch: Before strict validation, run a lenient pre-pass keyed on the schema: coerce numeric/boolean strings where the schema expects
number/integer/boolean, andjson.loadsstring values where the schema expectsarray/object. Only fall back to the schema-repair retry loop if coercion still fails. Add fixtures from real glm outputs.