Skip to content

Add deterministic overflow archive strategy for compaction #15

@chubes4

Description

@chubes4

Problem

Some inputs are too large to safely send through a model summarizer. Data Machine hit this with a ~250KB MEMORY.md: the request reached OpenAI but returned 0 bytes until the full request timeout. Raising timeouts is not the right fix.

Goal

Agents API should provide a deterministic overflow strategy that preserves content without invoking a model.

Proposed Shape

  • Policy fields:
    • overflow threshold
    • target retained size/count
    • archive strategy enabled/disabled
  • Strategy behavior:
    • split ordered items at safe boundaries
    • retain a small active subset
    • archive the remainder verbatim
    • emit pointer/stub metadata for where archived content should be referenced
    • never discard original content
  • The consumer supplies persistence/archive destinations; Agents API only returns the transformed item sets and metadata.

Acceptance Criteria

  • Oversized inputs can be transformed without calling a summarizer.
  • Archived items are returned verbatim with IDs and metadata intact.
  • Retained output includes enough metadata for a consumer to write an archive pointer.
  • Tests cover large input, no-op small input, single unsplittable item, and deterministic output.

Notes

This generalizes Data Machine's runaway Daily Memory circuit breaker without moving Data Machine file writes into Agents API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions