test: assert the max_tokens error names the SDK's own number#28
Merged
Conversation
Follow-up to #27. Two gaps in its tests: - The real-ceiling assertions (128000, 262144) sat inside test_accept_valid_values alongside 1/100/1000, so a failure there would not say which kind of value broke. Split into their own test with the probe evidence attached. - Nothing asserted the message content. The whole reason #27 exists is that the old text, 'max_tokens too large (maximum: 100000)', read like a provider response and was recorded as an upstream model ceiling in a downstream token table. If the message regresses to that shape the bug returns, and no test would have caught it. Now pinned: the message must name the SDK's own limit and disclaim being a model limit. Also references MAX_TOKENS_SANITY_LIMIT instead of hardcoding 2_000_000, so the test follows the constant if it moves.
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.
Follow-up to #27. Two gaps in its tests.
The real-ceiling assertions were buried.
validate_max_tokens(128000)and(262144)sat insidetest_accept_valid_valuesnext to1,100,1000. A failure there wouldn't say which kind of value broke. Split into their own test with the probe evidence attached.Nothing asserted the message content. That is the actual bug #27 fixed. The old text —
max_tokens too large (maximum: 100000)— reads like a provider response, and it was taken for one: recorded as an upstream model ceiling and propagated into a downstream token table on the strength of 19 identical "rejections" that never left the process. If the message regresses to that shape the same misreading is available again, and no test would have caught it. Now pinned: the message must name the SDK's own limit and disclaim being a model limit.Also references
MAX_TOKENS_SANITY_LIMITrather than hardcoding2_000_000, so the test follows the constant if it moves.373 pass.