Problem
AgentConversationCompaction is currently transcript-shaped: it operates on normalized message envelopes and uses conversation-specific boundary rules. Persistent memory compaction needs the same safety model, but over generic ordered items such as markdown sections, memory records, daily archive chunks, or tool traces.
Goal
Introduce a generic compaction item contract that conversation compaction and future memory compaction can both use without forcing markdown sections into fake chat messages.
Proposed Shape
- Define a normalized item shape or value object with:
id
type
content
metadata
- optional grouping/boundary hints
- Add normalization helpers similar to
AgentMessageEnvelope::normalize_many().
- Keep provider/model execution out of Agents API.
- Keep Data Machine vocabulary out of Agents API.
Acceptance Criteria
- Agents API exposes a public item normalization contract for compaction inputs.
- Conversation compaction can continue using message envelopes without breaking public API.
- Tests cover valid items, invalid/missing item fields, stable IDs, metadata preservation, and ordering.
Notes
This is the foundation for later MEMORY.md and daily-memory compaction without coupling Agents API to Data Machine files.
Problem
AgentConversationCompactionis currently transcript-shaped: it operates on normalized message envelopes and uses conversation-specific boundary rules. Persistent memory compaction needs the same safety model, but over generic ordered items such as markdown sections, memory records, daily archive chunks, or tool traces.Goal
Introduce a generic compaction item contract that conversation compaction and future memory compaction can both use without forcing markdown sections into fake chat messages.
Proposed Shape
idtypecontentmetadataAgentMessageEnvelope::normalize_many().Acceptance Criteria
Notes
This is the foundation for later MEMORY.md and daily-memory compaction without coupling Agents API to Data Machine files.