fix(agent): address review feedback on file modification tracking#118
Conversation
Addresses review feedback on #116. - Deduplicate path resolution: file_modifications now reuses crate::tools::fs::resolve_path instead of carrying local copies of resolve_path / expand_env_vars. - render_reminder logs and bails on real DB errors instead of swallowing them via .ok()?, so an open/query failure is no longer indistinguishable from "no snapshots". - render_file_block distinguishes a deleted file (reported as an external modification) and an unreadable file (logged) from an unchanged file, instead of collapsing all three to None. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code ReviewOverviewClean follow-up to #116. All three blocking issues are correctly resolved: path-resolution deduplication, error logging in What is done wellDeduplication via pub(crate) — making Error logging — replacing Deletion handling — Comment reduction — dropping WHAT-only docs on Minor issues1. No test for the deletion path ( The new 2. The new single-line doc says: "Render a single 3. Long single-line doc on The collapsed doc runs well past 100 characters. Either split it at the SummaryNo blocking issues. Fix 1 (missing test) is the most worth addressing before merge; the other two are nits. The core logic changes are correct and the codebase is cleaner after this PR. |
Addresses review feedback on #116 (file modification tracking).
Blocking fixes
Eliminate duplicated
resolve_path/expand_env_vars.file_modifications.rscarried local copies of both helpers that already live intools/fs.rs(same crate).resolve_pathis nowpub(crate)intools/fs.rsand imported viacrate::tools::fs::resolve_path; the local copies are deleted.expand_env_varsstays private tofs.rssince it has no cross-module caller after the dedup.Stop swallowing errors in
render_reminder. TheConversationStore::openandget_file_snapshots_for_agentcalls used.ok()?, which collapsed a real DB failure into the sameNoneas "no snapshots." Both now log viatracing::warn!before returningNone.Distinguish unreadable from unchanged in
render_file_block.std::fs::read(...).ok()?meant a deleted or unreadable file silently vanished from the report. ANotFounderror now emits a "File was deleted." modification block (a deletion is itself an external change worth reporting); any other read error is logged; only a genuine hash match returnsNone.Style fixes
hash_bytes,parse_write_path), keeping only WHY comments.// ===…===section banner this PR had added tostore.rs(therecord_file_snapshotdoc already conveys the upsert behavior). Pre-existing banners elsewhere instore.rswere left untouched.Verification
cargo build -p tenex-agent— clean (no new warnings; deletion of the local helpers leaves no unused import)cargo test -p tenex-agent— 58 passed (incl. all 4file_modificationstests)cargo test -p tenex-conversations— 19 passed🤖 Generated with Claude Code