Repository navigation
fix(agent): fire file-modification reminder exactly once - #125
Conversation
…to user message Adds `HookEvent::PreExecute` to the hooks system: fires once per turn before the LLM call, cannot block, and injects stdout into the user message as `<system-reminder type="pre-execute-hook">` blocks. Moves the active-tools, active-shell-tasks, and file-modifications `<system-reminder>` blocks from the system prompt to the user message so the system prompt stays byte-stable across re-engagements and maintains prompt-cache hits. https://claude.ai/code/session_01PHKUKH8Ejfq3yeE8DuwJob
…ered snapshots When render_reminder detects externally-modified files it now deletes those snapshot rows after building the reminder. The reminder text is embedded in the user message and carries forward in the conversation history; without this deletion it would re-fire on every subsequent run. Snapshots for unmodified files are preserved as valid baselines so future external changes can still be detected. Only triggered (modified) snapshots are removed. Also adds ConversationStore::delete_file_snapshots and two new tests covering the fire-once guarantee and the selective-deletion behaviour. https://claude.ai/code/session_01PHKUKH8Ejfq3yeE8DuwJob
Code ReviewState: MERGED — leaving notes for future reference and follow-up. OverviewThis PR does three things:
All three are well-motivated and correctly implemented. The broken-pipe fix in Issues
|
Summary
render_remindernow deletes the snapshot rows for files it reports after building the reminder. The reminder text is embedded in the user message and carries forward in the conversation history — re-generating it on every subsequent run would duplicate information.ConversationStore::delete_file_snapshots(ids: &[i64])to support the deletion.Test plan
external_modification_produces_diff_reminder— extended to verify a secondrender_remindercall returnsNoneafter the first firesunmodified_snapshot_survives_after_modified_snapshot_clears— verifies selective deletion: a stable file's snapshot survives and still triggers when that file is later modified externallyGenerated by Claude Code