-
-
Notifications
You must be signed in to change notification settings - Fork 328
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Basic checks
- I searched existing issues - this hasn't been reported
- I can reproduce this consistently
- This is a RubyLLM bug, not my application code
What's broken?
When using acts_as_tool_call message: :llm_message to configure a custom association name, the cleanup_orphaned_tool_results method in chat_methods.rb ignores this configuration and calls .message directly, causing NoMethodError.
How to reproduce
- Configure a custom message association name:
class LLMToolCall < ApplicationRecord
acts_as_tool_call message: :llm_message
end
- Run a chat with tool calls that triggers
cleanup_orphaned_tool_results - Error occurs at line 221 in lib/ruby_llm/active_record/chat_methods.rb
Expected behavior
The gem should use the configured association name (:llm_message) instead of hardcoded .message
What actually happened
NoMethodError: undefined method 'message' for an instance of LLMToolCall
The offending code at lib/ruby_llm/active_record/chat_methods.rb:221:
tool_call_message = last.parent_tool_call.message
Environment
- Ruby: 3.4.7
- ruby_llm: 1.9.1
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working