Skip to content

v0.10.4 - railtie auto-loads ruby_llm_contract:optimize rake task

Latest

Choose a tag to compare

@justi justi released this 10 Jun 17:34
· 3 commits to main since this release

Patch release: ruby_llm_contract:optimize rake task now auto-loads in Rails apps.

Why this matters

Adopter running bin/rails ruby_llm_contract:optimize per the docs got Unrecognized command. The docs claimed the task was "included" with RubyLLM::Contract::RakeTask, but the railtie did not load rake_task.rb — adopters had to manually add require "ruby_llm/contract/rake_task" to their Rakefile or lib/tasks/*.rake.

Fixed

  • Railtie auto-loads the rake task file using the standard rake_tasks { require ... } idiom. Boot path is unchanged — the file is loaded lazily during rake invocation, not on Rails app startup. Adopters from 0.10.4+ get both ruby_llm_contract:optimize and ruby_llm_contract:eval without touching their Rakefile.
  • Docs corrected. docs/guide/optimizing_retry_policy.md previously stated the task came with RubyLLM::Contract::RakeTask.new(...). The new wording is explicit: Rails apps on 0.10.4+ auto-load; older Rails versions and non-Rails projects still need the explicit require.

Background

Discovered via dogfooding on the seo-audit project trying to run the optimize task after the 0.10.3 nullable-validator fix unblocked its strict-mode contracts.

Notes

  • Non-Rails / older-Rails setup unchanged: add require "ruby_llm/contract/rake_task" to any file under lib/tasks/ or to Rakefile.
  • Suite: 1406 examples / 0 failures / 7 pending (unchanged from 0.10.3).

Full diff: v0.10.3...v0.10.4