Skip to content

Hermes Agent context engine: the main model writes the compaction handoff on its cached prompt prefix

2.1 KB
Raw Blame
manifest_version: 2
name: warm_compaction
version: 0.2.0
description: "Context engine: the main model writes the compaction handoff on the cached request prefix. Fallback summary when that is not possible."
kind: standalone
author: Elevatormusic
homepage: https://github.com/Elevatormusic/hermes-warm-compaction
tags: [context-engine, compaction]
provides_hooks:
  - pre_api_request
  - post_api_request
  - on_session_finalize
  - on_session_reset
config_schema:
  threshold:
    type: float
    default: 0.5
    description: Fraction of the context window at which automatic compaction starts (0.10 to 0.95).
  tail_tokens:
    type: int
    default: 0
    description: Size of the verbatim tail in tokens. 0 means 2.5% of the context window, from 10000 to 25000.
  user_copy_chars:
    type: int
    default: 24000
    description: Total characters of copied user messages in the summary.
  warm:
    type: bool
    default: true
    description: Use the warm request. Set false for comparison runs.
  ledger:
    type: bool
    default: true
    description: Add the work ledger (commands with exit codes and first error lines, changed files) after the summary. Set false for comparison runs.
  fallback_format:
    type: str
    default: relaxed
    description: Format of the fallback summary. relaxed uses the free handoff sections; quoted builds every section from verified source quotes.
  ledger_on_failure:
    type: bool
    default: true
    description: When both model summaries fail and the rows before the tail have tool work, compact with a ledger-only summary instead of stopping. Applies only when ledger is true.
  timeout_s:
    type: float
    default: 300.0
    description: Time limit in seconds (10 to 3600) for the warm request, and the shared deadline of the fallback summary calls.
  summary_words:
    type: int
    default: 600
    description: Word count the handoff instruction asks for, for the warm request and the fallback summary.
  warm_providers:
    type: str
    default: ""
    description: Comma-separated provider names that may use the warm path. Empty means every provider.