Expand description
Post-compaction re-injection of recently-read files as System attachments.
After an LLM-summary compaction, the transcript is [summary, …recent N].
The summary mentions file paths but not their contents, so the model on
the next turn frequently re-Reads files it already read — paying for the
read again and re-bloating the context.
FileReinjector re-injects the most-recently-read files as
[Role::System] attachments right after the summary, capped at
max_files files, token_budget total tokens, and per_file_budget
per file, deduplicated against the preserved tail.
Structs§
- File
Reinjector - Post-compaction re-injector for recently-read files.
- Plan
Todo Reinjector - Post-compaction re-injector for the pending plan and task list.
- Skill
Reinjector - Post-compaction re-injector for invoked skills.
Functions§
- build_
file_ reinjector_ from_ env - Build a
FileReinjectorfrom environment variables, returningNonewhen file re-injection is disabled. - build_
skill_ reinjector_ from_ env - Build a
SkillReinjectorfrom environment variables, returningNonewhen skill re-injection is disabled.