fix: preserve explicit tool response content

This commit is contained in:
King Star 2026-07-23 03:11:48 +08:00
commit 43a0ba6266
No known key found for this signature in database

View file

@ -16,6 +16,12 @@ module MCP
refute response.error?
end
test "#content_provided? distinguishes empty content from omitted or nil content" do
assert Response.new([]).content_provided?
refute Response.new.content_provided?
refute Response.new(nil).content_provided?
end
test "#initialize with content and error set to true" do
content = [{
type: "text",