When Templates generate malformed tool calls or structured outputs detectable statically at the level of the tool signature or output schema, we should probably be removing the failures early from the message sequence once a corrected version is generated in order to minimize context usage.
Note this is distinct from semantic failures in tool calling, where we may generate a correctly typed tool call that fails when executing the body of the tool. These need to persist for the duration of a Template call.