agent-zero/plugins/_chat_compaction/AGENTS.md
Alessandro 53ad7ba2dc Persist loaded skills through compaction
Store explicitly loaded skill IDs as chat-wide context data while keeping full skill bodies in normal tool-result history. Reattach any loaded skill body that is no longer visible after compaction by reimporting the current skill from its source, without revision hashes or protocol reinjection.

Update compaction and summary prompts to preserve loaded skill names only, refresh DOX contracts, and add focused coverage for context-data persistence, legacy agent-data migration, duplicate suppression, and post-compaction reattachment.
2026-06-23 16:32:21 +02:00

1.2 KiB

Chat Compaction Plugin DOX

Purpose

  • Own compacting an entire chat history into a single optimized summary message.
  • Keep compaction prompt, helper, API, and modal behavior aligned.

Ownership

  • plugin.yaml and default_config.yaml own metadata and compaction defaults.
  • api/compact_chat.py owns the compaction endpoint.
  • helpers/compactor.py owns summary generation and history rewrite logic.
  • prompts/ owns compaction system and message prompts.
  • webui/ owns the compaction modal and store.

Local Contracts

  • Preserve chat history integrity and persistence after compaction.
  • Backup JSON and transcript artifacts must remain UTF-8 writable when chat content contains malformed Unicode such as lone surrogates.
  • Keep generated summaries bounded by configured model and token limits.
  • Preserve loaded skill names from skill_instructions metadata without copying full skill bodies into compacted summaries.
  • Do not discard original context data unless the compaction flow explicitly owns that behavior.

Work Guidance

  • Coordinate prompt changes with helper behavior and UI confirmation text.

Verification

  • Smoke-test compacting a chat and reloading it after persistence.

Child DOX Index

No child DOX files.