Skip to content

fix: route unmatched when LLMMessagesRouter gets no reply text - #12794

Open
MohammadHijjawi97 wants to merge 1 commit into
deepset-ai:mainfrom
MohammadHijjawi97:fix/llm-messages-router-empty-reply
Open

MohammadHijjawi97 wants to merge 1 commit into
deepset-ai:mainfrom
MohammadHijjawi97:fix/llm-messages-router-empty-reply

Conversation

@MohammadHijjawi97

Copy link
Copy Markdown

Related Issues

No existing issue. This PR includes a regression test for the crash.

Proposed Changes:

Proposed Changes:

LLMMessagesRouter indexed generator_result["replies"][0].text. Empty replies raised IndexError. A reply with text=None raised TypeError in re.search. Treat missing or non-string reply text as unmatched.

How did you test it?

Added unit tests for empty replies and None reply text.

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

Indexing replies[0].text crashed with IndexError on empty replies and TypeError when text was None.

Co-authored-by: Cursor <cursoragent@cursor.com>
@MohammadHijjawi97
MohammadHijjawi97 requested a review from a team as a code owner September 17, 2026 11:05
@MohammadHijjawi97
MohammadHijjawi97 requested review from sjrl and removed request for a team September 17, 2026 11:05
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

@MohammadHijjawi97 is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Sep 17, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @MohammadHijjawi97, thanks for your interest in contributing to Haystack! 🙏

⚠️ You currently have 5 open pull requests in this repository (#12793, #12792, #12791, #12790 and this one). Our review capacity is limited, so please hold off opening more PRs until we've had a chance to review your first 2 open PRs. This helps us give each contribution the attention it deserves. Thank you!

This is an automated message to help us keep the review queue healthy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants