From b2dd524ffa9a0ec35c9e8c806b40972959fbc2a0 Mon Sep 17 00:00:00 2001 From: aoki-ryusei Date: Fri, 26 Jun 2026 18:49:11 +0900 Subject: [PATCH] Fix ActiveModel::UnknownAttributeError when response_format is passed to Mock provider Mock::Request had a hardcoded `response_format` method that always returned `{ type: "text" }` but no attribute definition, causing ActiveModel to raise UnknownAttributeError when the value was assigned during request casting. --- lib/active_agent/providers/mock/request.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/active_agent/providers/mock/request.rb b/lib/active_agent/providers/mock/request.rb index 57059c58..eac8a754 100644 --- a/lib/active_agent/providers/mock/request.rb +++ b/lib/active_agent/providers/mock/request.rb @@ -22,16 +22,13 @@ class Request < Common::BaseModel attribute :stream, :boolean, default: false attribute :tools # Array of tool definitions attribute :tool_choice # Tool choice configuration + attribute :response_format # Common Format Compatibility def message=(value) self.messages ||= [] self.messages << value end - - def response_format - { type: "text" } - end end end end