mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-17 23:52:34 +00:00
1.6 KiB
1.6 KiB
Everything looks correct. Here's a summary of what was done:
Changes Made
File: lib/crates/fabro-workflows/src/cli/backend.rs
1. Extracted track_file_event helper function (lines 33–75)
A new recursive function that handles file-tracking logic for write_file/edit_file tool calls:
ToolCallStarted→ records thefile_pathargument inpending_tool_callskeyed bytool_call_idToolCallCompleted(non-error) → moves the path frompending_tool_callstofiles_touchedand updateslast_file_touchedToolCallCompleted(error) → removes frompending_tool_callswithout recordingSubAgentEvent→ recursively unwraps the inner event and calls itself (handles arbitrarily nested sub-agents)- Everything else → no-op
2. Refactored spawn_event_forwarder to use track_file_event
Replaced the inline match block with a single call to track_file_event(&event.event, ...), which now handles both top-level and sub-agent events.
3. Added 4 unit tests
track_file_event_records_top_level_write— verifies basicwrite_filetracking still workstrack_file_event_unwraps_sub_agent_edit— verifiesSubAgentEvent-wrappededit_filecalls are trackedtrack_file_event_unwraps_nested_sub_sub_agent— verifies double-nestedSubAgentEvent(sub-sub-agent) is handledtrack_file_event_error_removes_pending— verifies errored sub-agent tool calls don't pollutefiles_touched
Verification
- ✅
cargo test -p fabro-workflows— 179 passed, 0 failed - ✅
cargo clippy --workspace -- -D warnings— clean