Skip to content

Design question: compaction preserves tool receipts but discards tool results — is receipts-only the intended contract? #879

Open

Description

@jrmvii

Not a bug — a question about what compaction is meant to preserve

Filed separately from #878 (which is a reachability defect) because this one is a design choice and deserves its own answer.

compactMessages keeps the first user message, subsequent user messages as "decisions", and then receipts of tool calls — name, category, issue, reference — but not their results (src/compaction.ts).

The consequence, once #878 is fixed: after compaction the agent remembers that it read config.txt successfully, but not what was in it. For a coding agent the file contents are usually the reason the turn happened at all, so the summary preserves the audit trail and drops the payload.

Why I noticed

I compared oh-my-cli against opencode on a local MLX server with a ~24k-token usable ceiling. opencode's compaction, once its context limit is declared, keeps enough of the content that a value read from a file in turn 1 is still answerable after compaction, without re-reading the file — verified end to end.

That is a different bet: receipts are cheap and auditable, content is expensive and useful. Both are defensible, but they lead to very different behaviour on long sessions, and the current docs do not say which one a user should expect.

Question

Is receipts-only the intended contract, or a first iteration? If intended, it would help to say so where --compact-threshold is documented — a user who reads "compaction" will assume the agent still knows what it learned.

A middle ground that would fit the existing structure: keep tool results for the most recent N turns verbatim (a tail_turns-style knob), receipts only beyond that.

Activity

  1. added
    priority:p3Low priority: address when capacity allows
    questionFurther information is requested
    on Aug 16, 2026
  2. github-actions commented on Aug 16, 2026

    @github-actions

    Automated intake triage

    • Type: question
    • Priority: priority:p3
    • Confidence: 0.95

    The reporter asks whether compaction is intentionally designed to retain only tool call receipts while discarding tool results, and requests documentation of the expected behavior.

    Reported evidence (unverified)

    • compactMessages keeps receipts of tool calls but not their results
    • after compaction the agent remembers that it read a file successfully but not what was in it
    • the reporter suggests documenting the receipts-only contract or keeping recent tool results verbatim

    Repository verification

    Pending. Repository verification is still required before this Issue can become agent-ready.

    This bounded pass classifies intake only. It cannot execute code, close the Issue, or grant governance authority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:p3Low priority: address when capacity allowsquestionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions