fix(models): make adapter call-time options explicit - #65
Merged
Merged
Conversation
dvd233
marked this pull request as ready for review
September 11, 2026 01:04
knisar
approved these changes
Sep 11, 2026
knisar
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for taking this on. I checked the adapter behavior, error handling, documentation, and mocked coverage at 9ffc4f3. I also ran the full suite and tested the result against current main. The two Weave jobs used the PR's older base and hit the test package import issue that is already fixed on main. The merged result passes locally. This is ready to merge.
This was referenced Sep 12, 2026
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.
Closes #63
What changed
TypeErrormessages.max_tokensoverride toOpenAICompatibleModel, while preserving the provider-default request shape when it is omitted.AnthropicModel's existingmax_tokensnormalization and made it explicit thatmax_tokensis the portable option;temperatureremains OpenAI-compatible-specific.The compatibility change is intentional: callers that relied on ignored keyword arguments now fail clearly instead of silently doing nothing.
Validation
python -m pytest -q tests/test_openai_compatible.py tests/test_anthropic.py: 104 passed, 2 skippedpython -m pytest -q(proxy environment cleared): 206 passed, 6 skippedpython -m ruff check --select E9,F63,F7,F82 .: passedreuse --no-multiprocessing lint: passedgit diff --check: passedcompileall, andpip check: passedAI assistance
AI assistance was used to inspect the scoped issue, draft the implementation and tests, and review edge cases. I personally reviewed the six-file diff and verified the behavior with mocked provider transports and the validation commands above.
Checklist
needed.