Skip to content

Make the RubyLLM provider work with ruby_llm 2.2 - #710

Merged
TonsOfFun merged 2 commits into
mainfrom
fix/ruby-llm-2.2
Nov 12, 2026
Merged

TonsOfFun merged 2 commits into
mainfrom
fix/ruby-llm-2.2

Conversation

@TonsOfFun

Copy link
Copy Markdown
Contributor

Why

ruby_llm 2.2.0 shipped on 2026-11-10 and every CI test leg on main has been red since (run 43279380137 on 5b514e23: 47 errors, 2 failures, all RubyLLM* tests and EvalsRubyLLMConversationTest). The three provider PRs waiting on fork CI (#705, #707, #709) fail for the same reason, as did #704's and #706's re-runs.

What changed in ruby_llm 2.2, and the fix

ruby_llm 2.2 Effect on the provider Fix
Message#tool_calls is a ToolCall::Collection; each yields the calls, keys are behind each_key |id, tc| blocks got the call as id, nil as tc → undefined method 'name' for nil each_tool_call yields key and call for a Hash (1.16–2.1) and for the collection
A streamed delta's provider ID moved to provider_call_id; id is nil on chunks every delta looked like a fragment, so calls merged and arguments doubled ({"city":"Denver"}{"city":"Denver"}) streamed_tool_call_id reads provider_call_id first
Chat#with_tools asks each tool for qualified_name, namespace, deferred? undefined method 'namespace' for ToolProxy ToolProxy answers name, nil, false

The evals conversation script mirrors RubyLLM's install migration and railtie, so it also learns 2.2's acts_as_chat modules (chat_files, chat_column_guard, … required where the release has them), the new tool-call and message columns, the unique [provider, model_id] index the 2.2 model upsert needs, and the reworded unavailable-tool error.

Verified

  • Full suite under gemfiles/ruby_llm_2.gemfile (ruby_llm 2.2.0): 4601 runs, 0 failures; the five RubyLLMIntegrationTest errors need a real key, as on main.
  • RubyLLM provider tests + conversation test under gemfiles/ruby_llm_1.gemfile (1.16.0): 85 runs, 0 failures.
  • RuboCop clean on the touched files.

CHANGELOG entry under Unreleased → Fixed. For 1.9.8.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PCEJHsJpjXpDa9Kuq9i4Yg

@TonsOfFun TonsOfFun added this to the 1.9.8 milestone Nov 12, 2026
@TonsOfFun TonsOfFun closed this Nov 12, 2026
@TonsOfFun TonsOfFun reopened this Nov 12, 2026
@TonsOfFun TonsOfFun closed this Nov 12, 2026
@TonsOfFun TonsOfFun reopened this Nov 12, 2026
@TonsOfFun TonsOfFun closed this Nov 12, 2026
@TonsOfFun TonsOfFun reopened this Nov 12, 2026
ruby_llm 2.2.0 (2026-11-10) turned every CI test leg red: 47 errors and 2
failures, all in the RubyLLM provider and the evals conversation check.
Three changes in the gem reached the provider:

- `Message#tool_calls` is a `ToolCall::Collection` whose `each` yields the
  calls, not ID-and-call pairs, with the keys behind `each_key`. The
  provider's `|id, tc|` blocks got the call as `id` and nil as `tc`.
  `each_tool_call` now yields key and call for a Hash (1.16 to 2.1) and for
  the collection alike.
- A streamed delta carries the provider's call ID in `provider_call_id`
  and leaves `id` nil until the message completes. The provider treated a
  nil `id` as an argument fragment, so each new call joined the latest one
  and the arguments doubled up (`{"city":"Denver"}{"city":"Denver"}`).
  `streamed_tool_call_id` reads `provider_call_id` first.
- `Chat#with_tools` registers a tool under `qualified_name` and reads
  `namespace` and `deferred?`. `ToolProxy` answers nil, the name and false.

The evals conversation script mirrors RubyLLM's install migration, so it
gains 2.2's `acts_as_chat` modules (chat_files, chat_column_guard and the
rest, required where the release has them), the `provider_call_id`,
`namespace`, `claimed_until` and MCP columns, the unique registry index the
2.2 upsert needs, and the reworded unavailable-tool error.

Full suite under gemfiles/ruby_llm_2.gemfile: 4601 runs, 0 failures (the
five RubyLLMIntegrationTest errors need a real key, as on main). The
RubyLLM provider tests under gemfiles/ruby_llm_1.gemfile (1.16.0): 85 runs,
0 failures. RuboCop clean.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PCEJHsJpjXpDa9Kuq9i4Yg
ubuntu-latest now resolves to ubuntu-26.04, where setup-ruby builds only
the latest patch of each series. The lint job pinned ruby-3.3.0 and failed
in Set up Ruby with "Unavailable version 3.3.0 for ruby on ubuntu-26.04".
"3.3" follows the series, as release.yml already does.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PCEJHsJpjXpDa9Kuq9i4Yg
@TonsOfFun
TonsOfFun merged commit 7e1661b into main Nov 12, 2026
18 checks passed
@TonsOfFun TonsOfFun mentioned this pull request Nov 12, 2026
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.

1 participant