Skip to content

chore: consolidate outputs to state string - #11902

Merged
davidsbatista merged 3 commits into
v3from
chore/consolidate-outputs-to-state-string-v3
Jul 8, 2026
Merged

chore: consolidate outputs to state string#11902
davidsbatista merged 3 commits into
v3from
chore/consolidate-outputs-to-state-string-v3

Conversation

@davidsbatista

Copy link
Copy Markdown
Contributor

Related Issues

Proposed Changes:

  • 4 functions in tools/tool.py had the same small loop copy-pasted: copy a config dict, and if it has a handler, convert it with serialize_callable/deserialize_callable.
  • Pulled that loop out into two small shared helpers (_convert_handler, _convert_handler_in_configs), and had all 4 functions call them instead.
  • The logic difference between the two config types stays where it was.

How did you test it?

  • Added test_serialize_outputs_to_state/test_deserialize_outputs_to_state first (they had no dedicated unit tests before, only indirect coverage via Tool.to_dict/from_dict round-trips), confirmed they pass against the old implementation, then refactored.

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.

@davidsbatista
davidsbatista requested a review from a team as a code owner July 7, 2026 14:41
@davidsbatista
davidsbatista requested review from bogdankostic and removed request for a team July 7, 2026 14:41
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
haystack-docs Ignored Ignored Jul 7, 2026 2:41pm

Request Review

@github-actions github-actions Bot added topic:tests type:documentation Improvements on the docs labels Jul 7, 2026
@claude

claude Bot commented Jul 7, 2026

Copy link
Copy Markdown

Code review

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

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack/tools
  tool.py
Project Total  

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

@davidsbatista davidsbatista added topic:core and removed type:documentation Improvements on the docs labels Jul 7, 2026
@davidsbatista
davidsbatista merged commit f317d87 into v3 Jul 8, 2026
33 checks passed
@davidsbatista
davidsbatista deleted the chore/consolidate-outputs-to-state-string-v3 branch July 8, 2026 11:27
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