Expand description
Stage 1โ2: shaping the conversation itself.
Both transforms rewrite the messages array and nothing else. They are
paired in shape_messages because they are the contiguous run of
message-level work in the pipeline โ see [super::apply] for why the order
within that run is fixed.
Functionsยง
- coalesce_
for_ ๐capabilities - Stage 2 โ merge consecutive same-role messages for strict-turn models.
- log_
payload_ ๐shape - Diagnostics for tracking down oversized payloads: the byte cost of every non-message top-level field, and the content size of every message.
- shape_
messages - Apply every message-level transform, in order.
- strip_
prior_ ๐reasoning - Stage 1 โ scrub reasoning artefacts from prior assistant turns.