fix: smart_edit — add output field, Claude-style diff, normalization typo #38
Merged
FO
4mo ago+333+333+012345678901234567890123456789-125-125-012345678901234567890123456789
Bugs Fixed
- Missing output field — caused
h.spliterror in tool framework - Normalization typo —
=== normalizedSlice(self-compare, always true) - No diff output — now shows Claude-style
● Update(file)blocks
Changes
src/tools/smart-edit.ts: AddedformatDiff()+ properToolResultreturn + typo fixtests/smart-edit.test.ts: Updated assertions for new{ title, output, metadata }format
Closes #38
Summary by cubic
Standardizes ToolResult ({ title, output, metadata }) across tools and adds a Claude‑style diff to smart-edit with better alignment and context. Fixes normalized matching and improves outputs for batch_patch, file_tree, research, smart_patch, and solution_confidence; pins @opencode-ai/plugin.
-
New Features
smart-edit: Adds Claude‑style diff with added/removed counts, improved lookahead realignment that emits the matched line as context, and clear titles.
-
Bug Fixes
- Standardized
{ title, output, metadata }returns acrosssmart_edit,smart_patch,batch_patch,file_tree,research,solution_confidence; fixes normalized match check; clearer batch rollback and single‑file file‑tree responses; tests updated; uses(ctx as any).callTool(...)where needed; pins@opencode-ai/pluginto1.15.13. research: Validatesqueriesas an array of strings and enforcesscopetobrain|web|both; safer typedcallToolusage; returns a titled JSON summary.
- Standardized
Summary by CodeRabbit
- New Features
- Smart edit now provides a Claude-style diff and richer match/method details in its response.
- Several tools now return standardized, structured responses (
title,output,metadata) for clearer results (file browsing, research, patching, confidence).
- Bug Fixes
- Improved edit matching and error reporting for exact vs whitespace-tolerant updates.
- Batch patching and rollback now return consistent, detailed success/failure summaries.
- Tests
- Updated test assertions to validate the new structured response shapes via
metadata.
- Updated test assertions to validate the new structured response shapes via
- Chores
- Bumped version to 0.4.2 and pinned
@opencode-ai/pluginto 1.15.13.
- Bumped version to 0.4.2 and pinned