Skip to content

fix(llm): surface truncated compatible responses - #3854

Open
koriyoshi2041 wants to merge 1 commit into
vectorize-io:mainfrom
koriyoshi2041:rios/fix-openai-length-finish-reason
Open

fix(llm): surface truncated compatible responses#3854
koriyoshi2041 wants to merge 1 commit into
vectorize-io:mainfrom
koriyoshi2041:rios/fix-openai-length-finish-reason

Conversation

@koriyoshi2041

Copy link
Copy Markdown
Contributor

Summary

  • map finish_reason="length" from OpenAI-compatible .create() responses to the canonical OutputTooLongError
  • avoid retrying the same truncated JSON response as a generic parse failure
  • add a regression proving the provider does not retry the request

This restores the existing retain auto-split path for the truncation case described in #3811.

Tests

  • uv run pytest tests/test_openai_compatible_response_hardening.py -q (9 passed)
  • ./scripts/hooks/lint.sh
  • pre-commit hooks, including unused-code checks and lint
  • git diff --check

@strix-security

strix-security Bot commented Aug 28, 2026

Copy link
Copy Markdown

Strix Security Review

Warning

This pull request has 4 commits after the last Strix review (81257e3). Strix has not reviewed these changes.
Automatic review on push is off for this repository. To review the latest changes, tag @strix-security in a comment, or turn on re-review on push.

No security issues found.

Updated for 81257e3.


Reviewed by Strix
Re-run review · Configure security review settings

@koriyoshi2041
koriyoshi2041 force-pushed the rios/fix-openai-length-finish-reason branch from 81257e3 to e6f5643 Compare August 28, 2026 14:33
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