Skip to content

Feature: Allow compaction model override (use cheaper model for summarization) #7926

@gamer-mitsuha

Description

@gamer-mitsuha

Problem

Compaction (conversation summarization) always uses the session's current model. When running an expensive model like Opus for conversation quality, the compaction step also runs on Opus — which is overkill for summarization and significantly increases cost.

Current Behavior

  • Compaction model = session model (no override possible)
  • compaction config only supports: mode, reserveTokensFloor, maxHistoryShare, memoryFlush
  • There is no compaction.model option

Desired Behavior

Allow specifying a separate model for compaction:

{
  "compaction": {
    "model": "anthropic/claude-sonnet-4",
    "mode": "safeguard"
  }
}

This would let users run their primary conversation on a high-quality model while using a cheaper model for the mechanical task of summarizing conversation history.

Use Case

  • Primary model: Opus ($15/M input, $75/M output) — for conversation quality
  • Compaction model: Sonnet ($3/M input, $15/M output) — 5x cheaper, sufficient for summarization
  • Or even use a non-Anthropic model (Gemini, etc.) for compaction to avoid metered API costs entirely

Notes

  • Summarization is a well-defined, lower-complexity task that doesn't require top-tier reasoning
  • The compaction prompt is structured (system-generated), so model compatibility should be straightforward
  • This would be especially valuable for users on metered API plans with weekly/monthly budgets

Environment

  • OpenClaw version: 2026.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions