Log sourceInferred, isIdle, deliveryBranch on session_compact and
mid_turn_deliver after steer for B-003 troubleshooting.
Co-authored-by: Cursor <cursoragent@cursor.com>
Cover steer delivery clearing pending, empty pending no-op, and skip
consume when steer already ran for the same compaction entry id.
Co-authored-by: Cursor <cursoragent@cursor.com>
Verify inject custom messages count as present in kept slice and are
ignored when compaction firstKeptEntryId starts after them.
Co-authored-by: Cursor <cursoragent@cursor.com>
Cover session_compact without prior before_compact inferring auto, and
manual /compact preserving manual source with reinject off by default.
Co-authored-by: Cursor <cursoragent@cursor.com>
resolveReinjectSkillNames includes tracked skills on disk when requireRegistered is false so /skill-reinject now works without resourceLoader entry.
Co-authored-by: Cursor <cursoragent@cursor.com>
buildReinjectBlocks uses tracked filePath/baseDir when resourceLoader has no entry and requireRegistered is false, completing defer-path B-002 injection.
Co-authored-by: Cursor <cursoragent@cursor.com>
planDeferredReinject locks pending by kept-window only; defer path in index uses it while immediate keeps registered filter at compact time.
Co-authored-by: Cursor <cursoragent@cursor.com>
Default false so CLI --skill paths can be re-injected from disk in later Phase 14 items; explicit true restores registered-only behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
RPC E2E with debug shows registered present at session_compact but planned=[]
because kept still contains the skill block; registered=[] still drops skills
absent from kept. Sync file readSettings avoids RPC hook deadlock on
SettingsManager/isProjectTrusted.
Co-authored-by: Cursor <cursoragent@cursor.com>
Expose settings.debug snapshots on session_compact and before_agent_start
so Phase 14 can see which filter stage drops --skill paths.
Co-authored-by: Cursor <cursoragent@cursor.com>
Every session_compact replans pendingReinject in defer mode; skipped reinject clears the queue unless manual compaction is waiting for the next user prompt.
Co-authored-by: Cursor <cursoragent@cursor.com>
Slash commands persist state changes in hasUI=false mode without calling notify; export handler for regression tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
Optional maxSkills setting sets the warn threshold; when unset, re-injecting more than three tracked skills emits a one-time UI warning without blocking delivery.
Co-authored-by: Cursor <cursoragent@cursor.com>
Duplicate names in resourceLoader resolve to the first skill with a one-time UI warning during re-inject expansion.
Co-authored-by: Cursor <cursoragent@cursor.com>
Stale pendingReinject from auto compaction is blocked until the next user prompt after manual /compact with default settings; a later auto compaction resets the clear flag.
Co-authored-by: Cursor <cursoragent@cursor.com>