Skip to content

[FEATURE]: per-agent compaction window #61696

Open

Description

@cevr

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Let an agent compact at its own window, below the model's.

I run several agents on one model: a planner and an implementor that should keep a long context, and short-lived workers that should compact early. Today automatic compaction plans for the model's window, so every agent on that model compacts at the same point. The per-model buffer in #43703 / #56443 can't separate them, since they share the model. (#34510 asked for per-agent on/off and was closed.)

Proposal: an agent may carry request.settings.compactionWindow (tokens). Automatic compaction uses the smaller of that and the model's window, with the usual buffer. It never raises the model's limit and doesn't change the summary request. A plugin sets it in agent.transform, so no config schema change is needed.

I have a small PR ready (core, about 20 lines plus tests).

Activity

  1. opencodejr commented on Nov 4, 2026

    @opencodejr

    Thanks for the clear write-up! You're asking for a per-agent compaction window: an agent could set a token window below its model's, and automatic compaction would then plan for the smaller of the two (with the usual buffer). That way, long-lived agents and short-lived workers on the same model could compact at different points.

    Today the compaction threshold comes only from the model's limits and the global compaction settings, so this can't be done with a plugin yet. Maintainers will consider the proposal and your PR.

    Related issues:

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions