Repository navigation
Upgrade ruby_llm to 2.1.1 (more built-in code + prompt_cache_key for every OpenRouter model + billed OpenRouter cost) - #13
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved accounting and API migration issues can undercount charges and break agent result collection or malformed-call recovery.
3 open issues
What changed in this PR
Upgrades Miniswen to RubyLLM 2.1.1 and integrates its built-in request handling and accounting features.
Changes:
- Migrates caching, reasoning replay, finish reasons, and output limits.
- Extends OpenRouter cache keys and uses provider-reported costs.
- Updates dependencies and remote credential forwarding.
| File | Description |
|---|---|
| test/miniswen/agent_test.rb | Updates API migration and accounting coverage. |
| test/lemans/agents/test_miniswen.rb | Tests content-filter outcome details. |
| miniswen.gemspec | Upgrades RubyLLM dependency. |
| lib/miniswen/testing.rb | Migrates test models and responses. |
| lib/miniswen/ruby_llm.rb | Updates logging, retries, and parsing overrides. |
| lib/miniswen/cli.rb | Updates registry refresh invocation. |
| lib/miniswen/agent.rb | Migrates requests, reasoning, and cost accounting. |
| lib/miniswen.rb | Updates registry refresh API. |
| lib/lemans/agents/miniswen.rb | Revises content-filter reporting. |
| lemans.gemspec | Updates dependencies and permits JSON 3. |
| Gemfile | Upgrades RubyLLM test support. |
| exe/lemans-remote | Expands provider credential forwarding. |
| CHANGELOG.md | Documents upgrade behavior. |
Review effort: Balanced
Replace caching, finish reason and reasoning replay code with built-ins, keep the ~10 min retry window, honor RUBYLLM_DEBUG.
ardecvz
force-pushed
the
feat/update-ruby-llm
branch
from
October 20, 2026 21:45
df6a500 to
b232e2a
Compare
baygeldin
approved these changes
Oct 21, 2026
baygeldin
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, but before merging I think we should double-check manually that caching works as expected (especially for Muse and Anthropic) - it should be higher than ~95%.
palkan
reviewed
Oct 22, 2026
| - Miniswen: send `prompt_cache_key` for every OpenRouter model, not only Muse, so a session keeps its cache without a pinned provider order. | ||
| - Miniswen: turn on prompt caching for every model, so models that need it (like Claude, including on the Anthropic API) cache, and those that cache automatically are unaffected. | ||
| - Miniswen: OpenRouter runs cost what OpenRouter actually billed (including discounts or a pricier provider), with registry prices as the rare fallback. | ||
| - Miniswen: trajectories record which upstream provider served each OpenRouter turn. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


RUBYLLM_DEBUG, allow JSON 3).prompt_cache_keyfor every OpenRouter model, not only Muse, so a session keeps its cache without a pinned provider order.lemans-remote: forward all provider keys RubyLLM reads, not onlyOPENROUTER_API_KEY.