diff --git a/gemfiles/ruby_llm_1.gemfile b/gemfiles/ruby_llm_1.gemfile index e9d704fd..f0b3a958 100644 --- a/gemfiles/ruby_llm_1.gemfile +++ b/gemfiles/ruby_llm_1.gemfile @@ -2,3 +2,9 @@ eval_gemfile "rails8.gemfile" # Keep the 1.x adapter covered while the other jobs resolve RubyLLM 2.x. gem "ruby_llm", "~> 1.16" + +# ruby_llm 1.x depends on faraday-net_http directly, and every recent Faraday +# requires faraday-net_http < 3.5, so once 3.5.0 shipped Bundler fell back to +# Faraday 2.0.0, which registers no :net_http adapter. A floor keeps a +# Faraday that can make requests. +gem "faraday", ">= 2.7" diff --git a/test/evals/support/ruby_llm_conversation_script.rb b/test/evals/support/ruby_llm_conversation_script.rb index a2ae5942..4bc9bc7d 100644 --- a/test/evals/support/ruby_llm_conversation_script.rb +++ b/test/evals/support/ruby_llm_conversation_script.rb @@ -110,15 +110,22 @@ def replay_json(messages) ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:") ActiveRecord::Migration.verbose = false - # RubyLLM's railtie requires these under Rails; a release that renames one - # reads as a skip naming the file rather than a crash. + # RubyLLM's railtie requires these under Rails, in its order; a release + # that renames one reads as a skip naming the file rather than a crash. + # 2.1 added record (the base class its models inherit from), mcp_credential + # and provider_file; they are required where the release has them. internals = if V2 - %w[payload_helpers model tool_call usage batch chat_methods message_methods acts_as] + %w[record payload_helpers model tool_call usage batch mcp_credential provider_file chat_methods message_methods acts_as] else %w[payload_helpers chat_methods message_methods model_methods tool_call_methods acts_as] end + since_2_1 = %w[record mcp_credential provider_file] begin - internals.each { |file| require "ruby_llm/active_record/#{file}" } + internals.each do |file| + next if since_2_1.include?(file) && $LOAD_PATH.none? { |dir| File.exist?(File.join(dir, "ruby_llm/active_record/#{file}.rb")) } + + require "ruby_llm/active_record/#{file}" + end rescue LoadError => e output["records"] = { "skipped" => "ruby_llm #{RubyLLM::VERSION}: #{e.message}" } puts JSON.generate(output)