unflatten_messages
Restore a flattened conversation by replacing [FLATTENED id=...] markers with original content from the extracted array, preserving the conversation byte-for-byte.
Instructions
Restore a conversation flattened by flatten_messages: re-inlines every tool_result whose content is a [FLATTENED id=...] marker from the matching entry in "extracted", byte-for-byte. Markers with no matching entry are left in place. Purely functional — no disk, no network, input never mutated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messages | Yes | The flattened messages[] array (the "messages" field of a flatten_messages result). | |
| extracted | Yes | The "extracted" array returned by flatten_messages for this conversation. |