Skip to content

Fix acts_as_tool_call message: option (#514)#515

Merged
crmne merged 2 commits intocrmne:mainfrom
saurabh-sikchi:fix-514-acts-as-tool-call-message-option
Mar 1, 2026
Merged

Fix acts_as_tool_call message: option (#514)#515
crmne merged 2 commits intocrmne:mainfrom
saurabh-sikchi:fix-514-acts-as-tool-call-message-option

Conversation

@saurabh-sikchi
Copy link
Contributor

@saurabh-sikchi saurabh-sikchi commented Nov 26, 2025

What this does

Fixes cleanup_orphaned_tool_results ignoring custom association names configured via acts_as_tool_call message: and acts_as_message tool_calls: options.

The bug: When using custom association names like acts_as_tool_call message: :llm_message, the cleanup method called hardcoded .message and .tool_calls instead of the configured association names, causing NoMethodError.

The fix: Use message_association and tool_calls_association methods, which respect the configured names.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Performance improvement

Scope check

  • I read the Contributing Guide
  • This aligns with RubyLLM's focus on LLM communication
  • This isn't application-specific logic that belongs in user code
  • This benefits most users, not just my specific use case

Quality check

  • I ran overcommit --install and all hooks pass
  • I tested my changes thoroughly
    • For provider changes: Re-recorded VCR cassettes with bundle exec rake vcr:record[provider_name]
    • All tests pass: bundle exec rspec
  • I updated documentation if needed
  • I didn't modify auto-generated files manually (models.json, aliases.json)

API changes

  • Breaking change
  • New public methods/classes
  • Changed method signatures
  • No API changes

Related issues

#514

@crmne crmne merged commit 9ae73f7 into crmne:main Mar 1, 2026
19 checks passed
@codecov
Copy link

codecov bot commented Mar 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.97%. Comparing base (8871844) to head (ae03ece).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #515      +/-   ##
==========================================
+ Coverage   80.95%   80.97%   +0.01%     
==========================================
  Files         114      114              
  Lines        5215     5215              
  Branches     1353     1353              
==========================================
+ Hits         4222     4223       +1     
+ Misses        993      992       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants