Skip to content

fix: preserve omitted state inputs when running an Agent in a Pipeline - #13832

Merged
anakin87 merged 3 commits into
mainfrom
agent-inputs-from-state-pipeline
Nov 20, 2026
Merged

anakin87 merged 3 commits into
mainfrom
agent-inputs-from-state-pipeline

Conversation

@anakin87

@anakin87 anakin87 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Related Issues

Proposed Changes:

  • change the default value of an Agent state input socket from None to _StateInputOmitted (a sentinel)
    • if the Pipeline caller passes an explicit value for the socket -> use it
    • if not, leave the key out of the State (previously we were using None)

The SuperComponent uses a similar mechanism. I also considered centralizing it at the Pipeline level, but for now I decided against it.

How did you test it?

CI, new tests

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.

@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
haystack-docs Ready Ready Preview Nov 20, 2026 12:21pm UTC

Request Review

@github-actions github-actions Bot added P1 High priority, add to the next sprint topic:tests type:documentation Improvements on the docs labels Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack/components/agents
  agent.py
  haystack/core/pipeline
  pipeline.py
Project Total  

This report was generated by python-coverage-comment-action

@anakin87
anakin87 marked this pull request as ready for review November 20, 2026 12:24
@anakin87
anakin87 requested a review from a team as a code owner November 20, 2026 12:24
@anakin87
anakin87 requested review from davidsbatista and sjrl and removed request for a team and davidsbatista November 20, 2026 12:24

@sjrl sjrl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@anakin87
anakin87 merged commit a0435a7 into main Nov 20, 2026
34 checks passed
@anakin87
anakin87 deleted the agent-inputs-from-state-pipeline branch November 20, 2026 14:18

This branch was successfully deployed

1 active deployment
Preview — adf3f859 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 High priority, add to the next sprint topic:tests type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool default arguments behviour changes when called Agent directly and via pipeline

2 participants