Extracts buildReinjectBlocks for shared expand logic; immediate delivery when the agent is idle uses sendUserMessage without deliverAs for the first block only.
Co-authored-by: Cursor <cursoragent@cursor.com>
Builds one injected custom message from pendingReinject via expandSkill, clears the queue only after content is built successfully.
Co-authored-by: Cursor <cursoragent@cursor.com>
Defer delivery stores planned skill names in pendingReinject for injection on the next before_agent_start, avoiding races with pi-auto-compact follow-ups.
Co-authored-by: Cursor <cursoragent@cursor.com>
Computes which tracked skills need re-inject after compaction by slicing the kept branch and excluding skills still present in kept user messages or unregistered on disk.
Co-authored-by: Cursor <cursoragent@cursor.com>