Codumentor logo Codumentor

Context Summarization Plugin

When a conversation is about to exceed the model's context window, this plugin
shrinks the prompt so the turn can still run. It keeps system prompts and the
most recent messages, and — by default — asks a model to summarize the middle
instead of dropping it silently. If summarization is off or fails, it falls
back to truncation.

It also retries after a context-window error from the model, using the same
shrink-and-retry path so a long conversation is more likely to continue than
to fail outright.

Configuration

plugins:
  - module: codumentor.plugins.context_summarization
    class: ContextSummarizationPlugin
    args:
      enabled: true
      max_context_tokens: 128000
      safety_margin: 1000
      min_recent_messages: 5
      split_ratio: 0.7
      enable_summarization: true

Parameters

args:
  model_context_limits:
    "Qwen3-235B-A22B-Instruct-2507": 262144

Aggressive truncation for small models

plugins:
  - module: codumentor.plugins.context_summarization
    class: ContextSummarizationPlugin
    args:
      enabled: true
      max_context_tokens: 16385
      safety_margin: 500
      min_recent_messages: 3
      split_ratio: 0.8

What you see

When a turn is summarized or truncated, a transcript card reports how many
messages were condensed, how many were kept, and roughly how many tokens were
saved. A pending card appears while summarization is running.

Each user can hide those cards in Settings (Show Summarization Cards,
on by default).

Notes