Skip to content

fix(api): align OpenAI validation and stop handling - #1443

Closed
sufubao wants to merge 1 commit into
ModelTC:mainfrom
sufubao:fix_openai_api
Closed

fix(api): align OpenAI validation and stop handling#1443
sufubao wants to merge 1 commit into
ModelTC:mainfrom
sufubao:fix_openai_api

Conversation

@sufubao

@sufubao sufubao commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • convert FastAPI request-validation failures into an OpenAI-style error envelope
  • omit configured stop sequences from Chat Completions and Completions output
  • buffer partial stop matches so streaming responses do not leak stop strings across chunk boundaries
  • add regression coverage for validation failures and streaming/non-streaming stop handling

Tests

  • python -m pytest -q unit_tests/server/test_openai_stop_sequences.py unit_tests/server/test_openai_validation_error.py unit_tests/server/test_api_responses.py unit_tests/server/test_qwen3_coder_stream_fc.py test/test_api/test_anthropic_extra_body.py (69 passed)
  • Black check (line length 120)
  • Flake8 check (repository configuration)
  • git diff --check

@shihaobai shihaobai closed this Aug 6, 2026
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.

2 participants