Implement :conflicts selector for read_file tool

- Add real git merge conflict extraction matching GJC behavior
- Extract unresolved conflict blocks (<<<<<<, =======, >>>>>>>)
- Support 3-way conflicts with diff3 markers (|||||||)
- Format conflicts as indexed summary with line ranges and labels
- Return clear 'No unresolved git merge conflicts' when clean
- Add comprehensive behavior tests for 2-way, 3-way, and no-conflicts cases
- Update documentation to mark :conflicts as implemented
- Closes #3323

Tests:
- read_with_selector_conflicts_no_conflicts: verifies clean file message
- read_with_selector_conflicts_two_way: verifies multiple conflict detection
- read_with_selector_conflicts_three_way: verifies diff3 marker support
This commit is contained in:
clawdbot committed 2026-10-12 23:57:50 +00:00
1 parent a2eb74c00e
commit 30f607e03a
2 files changed
+266 -3

No files matched your search

+3 -2
View File
@@ -222,7 +222,7 @@ pub fn read_file_in_workspace(
**Missing**:
- ✗ Line range selectors (`:L-L+N` syntax)
- ✗ Raw mode (`:raw`)
- ✗ Git merge conflict extraction (`:conflicts`)
- ✓ Git merge conflict extraction (`:conflicts`)
- ✗ Truncation footers with recovery hints
- ✗ Structural summarization (collapse braces)
- ✗ Archive/SQLite support
@@ -272,7 +272,8 @@ pub fn read_file_in_workspace(
### Batch 1: READ Tool (Priority P0)
- Add line range selector parsing
- Implement `:raw` and `:conflicts` modes
- Implement `:raw` mode
- ✓ Implement `:conflicts` mode
- Add truncation footers with recovery hints
- Implement structural summarization
- Add tests for all selector combinations