fix(llm): accept nullable Anthropic input usage - #44128
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential duplicate found:
This PR appears to be addressing the same issue as PR #44128. Both are fixing Anthropic's nullable input usage/tokens handling in the LLM package. PR #44116 likely covers the same or very similar functionality for handling |
|
Context on the duplicate flag: this PR reopens #44102, which was created at 08:55 UTC before #44116 at 11:16 UTC, after #44102 was automatically closed by the two-hour PR-template deadline while I was completing validation. I compared the current diffs and they are byte-for-byte identical. I am happy for the maintainers to keep whichever PR is easiest to review; there was no intent to duplicate another contributor's work. |
553a468 to
a249393
Compare
a249393 to
f2b4985
Compare
Issue for this PR
Closes #43759
Type of change
What does this PR do?
Accepts
nullfor Anthropic's terminalinput_tokens. Normalized usage keeps the earlier count frommessage_start, while raw provider metadata preserves the terminalnull. Adds a regression test for both behaviors.How did you verify your code works?
bun test test/provider/anthropic-messages.test.ts --timeout 30000frompackages/llm— 29 passedbun typecheckfrompackages/llm— passedgit diff --checkpassedScreenshots / recordings
Not applicable.
Checklist