Skip to content

fix: handle empty Qwen choices - #994

Merged
harry0703 merged 1 commit into
harry0703:mainfrom
Sushanth012:fix-qwen-empty-choices
Jun 5, 2026
Merged

harry0703 merged 1 commit into
harry0703:mainfrom
Sushanth012:fix-qwen-empty-choices

Conversation

@Sushanth012

Copy link
Copy Markdown
Contributor

Summary

  • detect explicit empty Qwen choices lists before falling back to output.text
  • return a clear Qwen empty choices error instead of an unclear empty text path
  • add a regression test for empty choices responses

Fixes #984

Testing

  • uv run --with pytest python -m pytest test/services/test_llm.py

@harry0703
harry0703 merged commit 15c2712 into harry0703:main Jun 5, 2026
@harry0703

Copy link
Copy Markdown
Owner

Thank you for the focused contribution.

I reviewed the patch and verified it locally with:

uv run --with pytest pytest test/services/test_llm.py -k qwen -q
# 4 passed

uv run --with pytest pytest test/services/test_llm.py -q
# 45 passed, 1 skipped

The change is small and targeted: Qwen responses with an explicit empty choices list now produce a clear [qwen] returned empty choices error, and the regression test covers that path.

Merged into main.

@kapil971390

Copy link
Copy Markdown
Contributor

Thanks for reviewing and addressing this so quickly. Glad the finding was useful and resulted in a fix. Really appreciate the discussion and contribution from everyone involved. 🙌

This issue was originally surfaced during analysis with VeriQA, so it's encouraging to see the feedback loop work in a real open-source project.

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.

bug: Qwen chat parser may crash with IndexError on empty choices list (commit ae52fec)

3 participants