Skip to content

test: Add regression test for unintended agent execution#11244

Merged
bogdankostic merged 2 commits intomainfrom
regression_test_agent
May 6, 2026
Merged

test: Add regression test for unintended agent execution#11244
bogdankostic merged 2 commits intomainfrom
regression_test_agent

Conversation

@bogdankostic
Copy link
Copy Markdown
Contributor

Related Issues

Proposed Changes:

This PR adds a regression test for #11109.

The test sets up a pipeline where a ConditionalRouter routes to a planning branch, leaving the BranchJoiner connected to Agent.messages un-triggered. It then runs the pipeline with a streaming_callback injected through pipeline.run(data=...) for the agent component. It asserts that the Agent does not run and that the underlying chat generator is never called, i.e. injecting an auxiliary input must not by itself trigger the component.

How did you test it?

I ran the test both with the current version of Agent and with the version where messages is optional (the test fails in this case).

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.

@bogdankostic bogdankostic requested a review from a team as a code owner May 4, 2026 15:28
@bogdankostic bogdankostic requested review from anakin87 and removed request for a team May 4, 2026 15:28
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
haystack-docs Ignored Ignored May 4, 2026 3:28pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Coverage report

This PR does not seem to contain any modification to coverable code.

@claude
Copy link
Copy Markdown

claude Bot commented May 4, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@anakin87
Copy link
Copy Markdown
Member

anakin87 commented May 5, 2026

This should fail with Haystack 2.27, right?

@bogdankostic
Copy link
Copy Markdown
Contributor Author

This should fail with Haystack 2.27, right?

Yes.

Copy link
Copy Markdown
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I struggled a bit to reproduce it. Sorry, now all good

@bogdankostic bogdankostic merged commit d3991b6 into main May 6, 2026
23 checks passed
@bogdankostic bogdankostic deleted the regression_test_agent branch May 6, 2026 07:11
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