Skip to content

Support per-agent compaction overrides (agents[].compaction.maxHistoryShare) #14446

Closed as not planned

Description

@thelostboysfactory

Problem

Currently cfg.agents.defaults.compaction.maxHistoryShare applies globally. In multi-agent systems, coordinator agents (e.g., orchestration layer) benefit from higher retention, while execution agents benefit from earlier compaction to avoid degradation.

We need per-agent compaction overrides, similar to how memorySearch, heartbeat, and humanDelay already support per-agent configuration.

Proposed Change

  1. Extend the schema to allow optional per-agent compaction configuration, for example:
agents:
  - name: Josh
    compaction:
      maxHistoryShare: 0.8
  1. In config resolution, compute the effective value as:
effectiveMaxHistoryShare = agentEntry.compaction?.maxHistoryShare ?? cfg.agents.defaults.compaction?.maxHistoryShare
  1. Pass effectiveMaxHistoryShare to setCompactionSafeguardRuntime() instead of only the default value.

Acceptance Criteria

  • Backward compatible if per-agent compaction is not specified.
  • Allows coordinator agents to retain longer history while execution agents compact earlier.
  • No changes required to existing configs.

If you're comfortable submitting a small PR implementing this (~10-15 lines of code), that would be ideal. Do not modify minified JS locally — we want maintainability and update safety.

Activity

  1. sebslight commented on Feb 13, 2026

    @sebslight
    Contributor

    Closing as duplicate of #13736. If this is incorrect, comment and we can reopen.

  2. locked as resolved and limited conversation to collaborators on Mar 5, 2026
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

    enhancement

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions