Defer planning, consume filter, disk fallback, and unit regression gate; short RPC E2E documented in docs/e2e-b002-post-fix.md.
Co-authored-by: Cursor <cursoragent@cursor.com>
Post-fix script and doc: automated tests cover loose defer path; short RPC session keeps skill in kept so compact reinject not triggered.
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>
Reflect completed checklist items for Phase 14 so the phase state matches
already-committed implementation and repro evidence.
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>
Закрывает план для BACKLOG B-002: отложенная registered-фильтрация в defer-path, loose fallback по filePath на диске, settings.requireRegistered как opt-out. Чеклист включает диагностический подпункт перед фиксом, чтобы подтвердить гипотезу о фильтре.
Co-authored-by: Cursor <cursoragent@cursor.com>
LiteLLM works via pi-provider-litellm; remaining gap is skill
registration for planReinject when skills load only via --skill CLI.
Co-authored-by: Cursor <cursoragent@cursor.com>
Document implemented status, pi -e installation, /skill-reinject usage,
and coexistence guidance per SPEC §9.1 and §16.7.
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>
Wire debug force re-inject through the existing immediate delivery path with registered skills from the session.
Co-authored-by: Cursor <cursoragent@cursor.com>
Persist autoCompactIntegration override in state and wire resolveDeliveryMode plus status delivery line.
Co-authored-by: Cursor <cursoragent@cursor.com>
Write skillReinject.enabled to ~/.pi/agent/settings.json via merge write without clobbering other keys.
Co-authored-by: Cursor <cursoragent@cursor.com>
Format enabled layer, delivery mode, tracked skills, pending queue, and last compaction source on bare command.
Co-authored-by: Cursor <cursoragent@cursor.com>
Append skill-reinject:state before extension teardown so the latest tracked
skills and session override survive quit, reload, and session replacement.
Co-authored-by: Cursor <cursoragent@cursor.com>
Extract restoreSessionState for reload/resume/startup and reuse on session_tree
so /tree branch navigation reloads persisted state or rescans like session_start.
Co-authored-by: Cursor <cursoragent@cursor.com>
Walk user messages and read tool calls on session_start to rebuild tracked
skills from history when no skill-reinject:state entry exists on the branch.
Co-authored-by: Cursor <cursoragent@cursor.com>
Restore skill-reinject:state from branch on startup/resume, read merged settings,
and detect pi-auto-compact; reset to initial state when no entry exists.
Co-authored-by: Cursor <cursoragent@cursor.com>
Connect compaction source gate with plan/enqueue/send paths and consume deferred queue on before_agent_start for end-to-end auto compaction trigger.
Co-authored-by: Cursor <cursoragent@cursor.com>
Call saveState via appendEntry after slash, skill-block, and read-path tracking so session state survives resume.
Co-authored-by: Cursor <cursoragent@cursor.com>
Match read tool paths against registered skills when trackReadPaths is enabled and upsert with source read.
Co-authored-by: Cursor <cursoragent@cursor.com>
Scan finalized user message text for expanded skill XML blocks and upsert tracked skills using registered metadata when available.
Co-authored-by: Cursor <cursoragent@cursor.com>
Wire input handler to detect slash skills and upsert into session state using registered skill metadata from before_agent_start cache or loadSkills fallback.
Co-authored-by: Cursor <cursoragent@cursor.com>