Skip to content

Commit fe4bec4

Browse files
author
Yoshihiro Takahara
committed
fix: Remove content from error response
1 parent b3feaa0 commit fe4bec4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/mcp_text_editor/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def edit_file_contents(
6565
result="error",
6666
reason="Content hash mismatch",
6767
hash=current_hash,
68-
content=current_content,
68+
content=None,
6969
)
7070
}
7171

tests/test_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def test_edit_file_contents_hash_mismatch(service, tmp_path):
119119
edit_result = result[file_path]
120120
assert edit_result.result == "error"
121121
assert "hash mismatch" in edit_result.reason.lower()
122-
assert edit_result.content == test_content
122+
assert edit_result.content is None
123123

124124

125125
def test_edit_file_contents_invalid_patches(service, tmp_path):

0 commit comments

Comments
 (0)