Skip to content

test: assert the max_tokens error names the SDK's own number#28

Merged
VickyXAI merged 1 commit into
mainfrom
test/max-tokens-message-assertions
Jul 21, 2026
Merged

test: assert the max_tokens error names the SDK's own number#28
VickyXAI merged 1 commit into
mainfrom
test/max-tokens-message-assertions

Conversation

@VickyXAI

Copy link
Copy Markdown
Contributor

Follow-up to #27. Two gaps in its tests.

The real-ceiling assertions were buried. validate_max_tokens(128000) and (262144) sat inside test_accept_valid_values next to 1, 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_LIMIT rather than hardcoding 2_000_000, so the test follows the constant if it moves.

373 pass.

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.
@VickyXAI
VickyXAI merged commit 0f209b4 into main Jul 21, 2026
3 checks passed
@VickyXAI
VickyXAI deleted the test/max-tokens-message-assertions branch July 21, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant