iflytek/astron-agent · error · Exception

{';'.join(er_msgs)}

Error message

{';'.join(er_msgs)}

What it means

do_validate runs CNValidator against a node's outputs using its declared schema and, if any validation errors are returned, raises a plain Exception joining all messages as 'Field: <path>, Error: <message>; ...'. It is schema validation of node output data against the node's output JSON schema.

Solutions

  1. Read the joined messages — each names the failing field path and reason — and fix the node's returned data to match the schema
  2. Update the node's declared output schema to correctly describe what it actually returns
  3. Ensure required fields are always populated (or marked not-required) before do_validate runs
  4. Add unit tests comparing real node outputs against the schema to catch drift early

Example fix

// before
return {"count": "5"}  # schema says integer
// after
return {"count": 5}  # matches declared schema type
Defensive patterns

Strategy: validation

Validate before calling

errors = CNValidator(schemas).validate(outputs)
assert not errors, [f"{e['schema_path']}: {e['message']}" for e in errors]

Type guard

def outputs_match_schema(outputs: dict, schemas: dict) -> bool:
    return not CNValidator(schemas).validate(outputs)

Try / catch

try:
    pool.do_validate(node_id, outputs)
except Exception as e:
    for msg in str(e).split(';'):
        log.error(f"output validation: {msg}")
    raise

Prevention

When it happens

Trigger: do_validate(node_id, outputs) — invoked from add_init_variable and async_execute — when outputs do not conform to the node's declared schema: missing required fields, wrong types, or failing nested constraints.

Common situations: Node implementation returns data whose shape differs from its declared output schema (e.g. returns string where object expected); optional fields emitted as null when required; schema tightened after node code was written.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/7eebf7b56f3a92e2. Report an issue: GitHub.

Appendix: source

Thrown at core/workflow/engine/entities/variable_pool.py:827

        """
        required = []
        schemas: dict = copy.deepcopy(self.validate_template)
        for mapping_key in self.output_variable_mapping.keys():
            if mapping_key.startswith(node_id):
                mapping_value = self.output_variable_mapping[mapping_key]
                value_schema = mapping_value.get("schema")
                key = mapping_key.split(f"{node_id}-")[-1]
                schemas["properties"].update({key: value_schema})
                if mapping_value.get("required", False):
                    required.append(key)
        if required:
            schemas.update({"required": required})
        er_msgs = [
            f"Field: {er['schema_path']}, Error: {er['message']}"
            for er in CNValidator(schemas).validate(outputs)
        ]
        if er_msgs:
            raise Exception(f"{';'.join(er_msgs)}")

    async def add_variable(
        self,
        node_id: str,
        key_name_list: list[str],
        value: NodeRunResult,
        span: Span,
    ) -> None:
        """
        Add variables to the variable pool with validation.

        :param node_id: ID of the node
        :param key_name_list: List of variable names to add
        :param value: NodeRunResult containing output and error values
        :param span: Span object for tracing
        """
        output_value = value.outputs
        if node_id.split(":")[0] == "node-end":

View on GitHub (pinned to 5e758547a8)