Repository navigation
Fix btw --version and require ellmer (>= 0.4.2) - #214
Merged
Merged
Conversation
Rapp command switches are required by default, so Rapp printed usage and exited before the script body ran, and the version flag was never checked. Mark the top-level switch as optional so the body (including the version block and the no-command self-help path) executes. Also suppress the generated --no-version alias.
Snapshot tests printing chat clients broke whenever ellmer changed its default model. Normalize it to DEFAULT_MODEL in scrub_system_info().
Guard the set_model() shim to ellmer < 0.4.2, the versions that predate Chat$set_model() and still use the @model slot. Also switch a test assertion to the get_model() accessor.
Remove the set_model() monkey-patch, now shipped by ellmer since 0.4.2, and replace client_get_models()'s provider dispatch table with ellmer's internal models_list() generic (tidyverse/ellmer#993). Also drop the dead ellmer <= 0.3.0 branch in chat_get_tokens().
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.
Summary
Fixes
btw --version, which previously printed Rapp's usage message and exited before the script body ran: Rapp marks top-level switches required by default, so the version flag was never checked. The top-level switch is now optional and the auto-generated--no-versionalias is suppressed.Also modernizes ellmer usage, raising the minimum version to 0.4.2:
set_model()monkey-patch — ellmer has shippedChat$set_model()since 0.4.2.client_get_models()'s 75-line per-provider dispatch table with a thin wrapper over ellmer's internalmodels_list()generic (feat: addmodels_list()S7 generic to Provider class tidyverse/ellmer#993), which now handles per-provider URL and credential details.chat_get_tokens().get_provider()@modelaccessor withget_model()in tests, and test snapshots no longer depend on ellmer's default Anthropic model (scrubbed toDEFAULT_MODELvia the snapshot transform).Verification