Skip to content

fix: load RubyLLM when the gem registers its acronym - #372

Merged
TonsOfFun merged 1 commit into
activeagents:mainfrom
aoki-ryusei:feature/rubyllm-provider-alias
Aug 24, 2026
Merged

fix: load RubyLLM when the gem registers its acronym#372
TonsOfFun merged 1 commit into
activeagents:mainfrom
aoki-ryusei:feature/rubyllm-provider-alias

Conversation

@aoki-ryusei

Copy link
Copy Markdown
Contributor

Summary

In a Rails app that bundles the ruby_llm gem, service: "RubyLLM" fails while loading the provider.

Bug

provider_load requires active_agent/providers/#{service_name.underscore}_provider.
The ruby_llm gem's railtie registers inflect.acronym "RubyLLM", so "RubyLLM".underscore becomes rubyllm and ActiveAgent looks for a missing file.

Failed to load provider ruby_llm: cannot load such file -- active_agent/providers/rubyllm_provider (RuntimeError)

Why fix it

Using the RubyLLM provider requires the ruby_llm gem, and that gem's Rails railtie registers the acronym. Real apps need service: "RubyLLM" to load.

How we fixed it

Added lib/active_agent/providers/rubyllm_provider.rb as a one-line alias of ruby_llm_provider.rb, matching openai_provider.rb.

Test Plan

  • A Rails app with ruby_llm can load an agent class that calls generate_with :ruby_llm with service: "RubyLLM"
  • The LoadError above does not occur
  • Existing generate_with :ruby_llm still loads ruby_llm_provider.rb when the ruby_llm railtie has not run

fixes #371

ruby_llm's railtie inflects "RubyLLM" as an acronym, so provider_load requires rubyllm_provider.rb. Add that alias, matching openai_provider.rb.
@TonsOfFun
TonsOfFun merged commit d69da04 into activeagents:main Aug 24, 2026
8 checks passed
TonsOfFun pushed a commit that referenced this pull request Aug 24, 2026
Takes main's rubyllm_provider.rb from #372 so the alias fix itself stays
out of this PR's diff.

# Conflicts:
#	lib/active_agent/providers/rubyllm_provider.rb
TonsOfFun pushed a commit that referenced this pull request Aug 24, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S5b2SozepYRbwEcFwkARek
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.

service: "RubyLLM" fails to load after ruby_llm registers its acronym

2 participants