Skip to content

Commit 5c802e5

Browse files
committed
fix: test failed attempt to yield across metamethod/C-call boundary
1 parent db91a0a commit 5c802e5

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

lua/claudecode/tools/open_diff.lua

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,28 +66,14 @@ local function handler(params)
6666
error({ code = -32000, message = "Internal server error", data = "Failed to load diff module" })
6767
end
6868

69-
-- Use the new blocking diff operation
70-
local success, result = pcall(
71-
diff_module.open_diff_blocking,
69+
-- Call the blocking diff operation directly (no pcall to allow yielding)
70+
local result = diff_module.open_diff_blocking(
7271
params.old_file_path,
7372
params.new_file_path,
7473
params.new_file_contents,
7574
params.tab_name
7675
)
7776

78-
if not success then
79-
-- Check if this is already a structured error
80-
if type(result) == "table" and result.code then
81-
error(result)
82-
else
83-
error({
84-
code = -32000, -- Generic tool error
85-
message = "Error opening blocking diff",
86-
data = tostring(result),
87-
})
88-
end
89-
end
90-
9177
-- result should already be MCP-compliant with content array format
9278
return result
9379
end

0 commit comments

Comments
 (0)