Agent Builder - JSON Schema editor duplicates required and breaks the editor

Saving a json_schema response format works once. Reopening the Advanced UI shows a massively duplicated required array. This is not on every json_schema but probably Running the workflow throw an error. Any attempt to edit/remove items or switch output type triggers:
can't access property "push", a.required is undefined

This leaves the step stuck: you can’t clean the schema or change the output type.

Expected

  • The editor preserves a unique required array.

  • Removing required items or switching output type doesn’t crash the UI.

Actual

  • On reopen, required contains hundreds of duplicates of the same 3 keys.

  • Deleting/adding items or changing output type throws a.required is undefined.

  • State becomes uneditable.

  • Page crash on selection of output format “Text”

Steps to Reproduce

  1. Create a step with response_format.type = “json_schema” named PhotoQuestQuestion.

  2. Paste this valid schema, Save:

{
“type”: “object”,
“title”: “PhotoQuestQuestion”,
“description”: “A structured multiple-choice question generated from a newspaper photo.”,
“properties”: {
“question”: { “type”: “string”, “description”: “The question related to the newspaper page.”, “default”: “” },
“answers”: {
“type”: “array”,
“description”: “An array of 4 possible answers. One is correct; the other three are incorrect.”,
“items”: { “type”: “string”, “description”: “A possible answer to the question.” },
“minItems”: 4, “maxItems”: 4, “default”:
},
“correct_answer_index”: { “type”: “integer”, “description”: “The index (0-based) of the correct answer in the answers array.”, “minimum”: 0, “maximum”: 3 }
},
“required”: [“question”,“answers”,“correct_answer_index”],
“additionalProperties”: false
}

  1. Reopen the schema editor. The required array is now duplicated many times.

  2. Try removing items or changing output type → error a.required is undefined.

  3. Attempting to remove schema elements also fails with the same error.

Impact

  • Cannot correct the schema.

  • Cannot switch the output type.

  • Workflow step is effectively bricked unless recreated under a new name.

UPDATES:

This is due to a data transformation that happens after the agent workflow

4 Likes

currently facing the same thing- any updates here?

Even if i remake the agent the duplicated field magically reappears- this is completely breaking the agent. i have removed the transformation node but it appears this agent is just fully broken now.

I cant even make a new agent! the entire platform is just broken now

1 Like

i changed the type of output from json to widget, updated and retried. resolved it . also have you removed the reference to the output in the next steps? i had to remove the agent, the link to the next step before making it work.

I had the same issue. It appeared only if the node was followed by if/else node with multiple ifs.

Workaround is to branch each if into a separate if/else node with just one if statement per node.

Thanks for the very clear repro and screenshot – this looks like a bug in the JSON-schema editor, and the malformed default on the answers property is likely what’s triggering it.


In the schema you pasted, the answers property has:

"default":

with no value. That’s not valid JSON, and the editor appears to get into a bad internal state when it tries to parse and then re-save the schema. On reopen, it repeatedly appends the same keys into required, and later when it tries to mutate required it hits a.required is undefined, which is why you can’t edit or switch the output type anymore.

As a workaround:

  1. Update the schema so that answers.default is either a valid JSON value (e.g. []) or remove default entirely. For example:
"answers": {
  "type": "array",
  "description": "An array of 4 possible answers. One is correct; the other three are incorrect.",
  "items": { "type": "string", "description": "A possible answer to the question." },
  "minItems": 4,
  "maxItems": 4
}
  1. Create a new step with response_format.type = "json_schema" and paste the cleaned schema.
  2. Save, close, and reopen the Advanced editor to confirm that:
    • required contains each key only once, and
    • editing or changing the output type no longer throws a.required is undefined.

Once the new step is working, you can delete the old broken one. We’ve flagged the behavior internally so the editor can handle malformed JSON more gracefully instead of corrupting required. Please let us know if this helps. Thank you!

1 Like