Skip to content

Run on ruby_llm 1.16 or 2.x; bump to 0.7.0 - #87

Merged
pdw207 merged 4 commits into
mainfrom
ruby-llm-2-compat
Sep 30, 2026
Merged

pdw207 merged 4 commits into
mainfrom
ruby-llm-2-compat

Conversation

@pdw207

@pdw207 pdw207 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Lets thingie run in a bundle on either ruby_llm 1.16 or 2.x, so special_sauce can move to ruby_llm 2.0 (bonusly/special_sauce#27487) without thingie holding it back. 0.6.1 pins ruby_llm ~> 1.16, ruby_llm-mcp ~> 1.0 and ruby_llm-skills ~> 0.3.0, so Bundler can't resolve it next to 2.0.

  • Gemspec: ruby_llm >= 1.16, < 3, ruby_llm-mcp >= 1.0, < 2, ruby_llm-skills >= 0.3.0, < 1. A default bundle still resolves to 1.16, because the released mcp and skills gems require 1.x.
  • Thingie::LlmCompat routes the four APIs that differ:
    • param :x, desc: becomes parameter :x, description:
    • message.input_tokens (and the other token readers) becomes message.tokens.input
    • models.refresh! becomes models.refresh
    • models.load_from_json! becomes models.load_from_json
  • The skills Loader/Skill/SkillTool API thingie uses is identical in 0.3.0 and 0.5.0.pre1, and RubyLLM.context and response parsing already work on both.
  • CI: the existing Specs job is unchanged (1.16). A new Specs (ruby_llm 2) job runs with gemfiles/ruby_llm_2.gemfile: ruby_llm 2.0, skills 0.5.0.pre1, and mcp from Support RubyLLM 2 while preserving RubyLLM 1 compatibility patvice/ruby_llm-mcp#161.

I couldn't run bundle exec rake locally because rugged doesn't build on this machine. CI runs the specs on both bundles and passes; RuboCop hasn't been run.

Bumps the version to 0.7.0. After merge: tag 0.7.0, move special_sauce main to it (still on 1.16), and restore thingie in #27487.

🤖 Generated with Claude Code

special_sauce is moving to ruby_llm 2.0, and 0.6.1's ~> 1.16 pins keep it
from resolving thingie in the same bundle. Widen the gemspec to
ruby_llm >= 1.16, < 3 (mcp >= 1.0, < 2; skills >= 0.3.0, < 1) and route
the four APIs that changed through Thingie::LlmCompat:

- param :x, desc: -> parameter :x, description:
- message.input_tokens (etc.) -> message.tokens.input
- models.refresh! -> models.refresh
- models.load_from_json! -> models.load_from_json

A default bundle still resolves to 1.16 (released ruby_llm-mcp and
ruby_llm-skills require 1.x). gemfiles/ruby_llm_2.gemfile pins the 2.x set,
and CI runs the specs on both.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Comment thread lib/thingie/stats/usage.rb Resolved
Comment thread spec/thingie/llm_compat_spec.rb Resolved
- message_double builds an instance_double(RubyLLM::Message) from 1.16-style
  token keys, as RubyLLM::Tokens on 2.x; model_info_class is Model::Info on
  1.16 and Model on 2.x.
- models.find takes one argument on 2.x (1.16 accepts it too).
- YARD @PARAM tags for LlmCompat's registry helpers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/ci.yml Resolved
@review-thingie

review-thingie Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Outdated Thingie summary
1 Thingie finding(s) outside this diff
  • Critical spec/thingie/reviewer_spec.rb:167 — Obfuscated code detected (a long hex-encoded blob)

1.16 also has Message#tokens, shaped differently (cached, cache_creation),
so checking #tokens first read a missing field on 1.16. Use the readers
when the message has them; message_double detects 1.16 the same way.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@review-thingie

review-thingie Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Outdated Thingie summary
2 Thingie finding(s) outside this diff
  • Critical spec/thingie/reviewer_spec.rb:167 — Obfuscated code detected (a long hex-encoded blob)
  • Low spec/thingie/verifier_spec.rb:43 — Continuation arguments misaligned after rename to message_double

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@pdw207 pdw207 changed the title Run on ruby_llm 1.16 or 2.x Run on ruby_llm 1.16 or 2.x; bump to 0.7.0 Sep 29, 2026
gem 'ruby_llm', '~> 2.0'
gem 'ruby_llm-skills', '0.5.0.pre1'
# patvice/ruby_llm-mcp#161: RubyLLM 2 support, not released yet.
gem 'ruby_llm-mcp', github: 'crmne/ruby_llm-mcp', ref: 'a8cc59c1647905b81b56bfda4b82b1db17e7e967'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing thingie with LLM 2.0

Comment thread lib/thingie/version.rb

module Thingie
VERSION = '0.6.1'
VERSION = '0.7.0'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bumping version

@pdw207
pdw207 marked this pull request as ready for review September 29, 2026 19:39
@pdw207
pdw207 requested a review from a team September 29, 2026 19:39

@sunitajennings sunitajennings left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice.

@review-thingie

Copy link
Copy Markdown
1 Thingie finding(s) outside this diff
  • Critical spec/thingie/reviewer_spec.rb:167 — Obfuscated code detected (a long hex-encoded blob)

@pdw207

pdw207 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

@pdw207

pdw207 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

Integration test successful

@pdw207
pdw207 merged commit 7ca0ec3 into main Sep 30, 2026
3 checks passed
@pdw207
pdw207 deleted the ruby-llm-2-compat branch September 30, 2026 14:24
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