[Bug]: Agent Builder leaves configuration empty when a completed draft omits its closing tag
Deployment type
self-host
Area
Web app
What happened?
Agent Builder said it had prepared an agent draft, but the configuration form stayed empty. Asking it to generate the draft again did not resolve the problem.
The persisted assistant reply contained a complete object after <agent_draft>, without </agent_draft>. Its instructions also contained literal line breaks inside the JSON string. The existing parser repairs those line breaks in closed blocks, but rejects an unclosed block; the transcript hides the block, so the user cannot see why the form was not filled.
Expected: recover this limited formatting error after the reply finishes, preserve subsequent manual edits, and show actionable guidance when the draft cannot be recovered. Any recovery notice should align with the conversation and composer at different panel widths.
Steps to reproduce
- Open Agent Builder and request an agent, for example a Chinese poetry persona.
- Use a runtime reply with the following shape. The line break inside
instructionsis literal, and the closing tag is absent:
Here is your draft.
<agent_draft>{"name":"Poet","instructions":"Write poetry.
Use the requested language.","permission_scope":"private"}- Let the reply finish. The prose appears, but the draft does not populate the configuration form.
- Retrying with the same output shape leaves the form empty again. This depends on the runtime output format; the persona request alone does not reproduce it deterministically.
Screenshots (optional)
Not attached. The reduced reply above captures the observed formatting failure.
Additional context (optional)
Observed on a local self-hosted web instance. The raw persisted reply was inspected to distinguish malformed draft formatting from a still-running generation. The parser and Builder UI are shared with desktop.
Source: multica-ai/multica