Commit graph

1 commit

Author SHA1 Message Date
teknium1
27e25c5419 feat(compression): configurable protect_first_n/protect_last_n turns
Add protect_first_n and protect_last_n to the compression config section
in config.yaml, allowing users to control how many initial and recent
turns are preserved during context compression.

- Default values: protect_first_n=3, protect_last_n=4 (no behavior change)
- Values clamped to 0-12 range (inspired by openclaw recentTurnsPreserve)
- Config version bumped to 6 for migration
- Also improved run_agent.py to read compression config from config.yaml
  (previously only read from env vars)

Related: #525 (microcompact)
2026-03-09 02:17:12 -07:00