Skip to content

test(streaming): cover partial JSON on max_tokens#1517

Open
wilyan09007 wants to merge 1 commit into
anthropics:mainfrom
wilyan09007:issue-794-partial-json-max-tokens
Open

test(streaming): cover partial JSON on max_tokens#1517
wilyan09007 wants to merge 1 commit into
anthropics:mainfrom
wilyan09007:issue-794-partial-json-max-tokens

Conversation

@wilyan09007
Copy link
Copy Markdown

@wilyan09007 wilyan09007 commented May 8, 2026

Summary:
Refs #794 by adding regression coverage for streaming tool-use input when max_tokens stops an incomplete JSON stream. The tests verify current behavior preserves partial JSON snapshots and parsed input.

Changes:

  • Add sync streaming coverage for incomplete partial JSON on max_tokens.
  • Add async streaming coverage for incomplete partial JSON on max_tokens.
  • Add beta streaming coverage for the same fixture.
  • Assert partial input_json events remain available.
  • Assert the final tool-use snapshot preserves parsed partial input.

Testing instructions:

  • Run uv run pytest tests\lib\streaming\test_messages.py tests\lib\streaming\test_beta_messages.py tests\lib\streaming\test_partial_json.py -q.
  • Run uv run ruff check tests\lib\streaming\test_messages.py tests\lib\streaming\test_beta_messages.py.
  • Run uv run ruff format --check tests\lib\streaming\test_messages.py tests\lib\streaming\test_beta_messages.py.
  • Confirm the incomplete JSON fixture still produces input_json events.

@wilyan09007 wilyan09007 requested a review from a team as a code owner May 8, 2026 00:31
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