Skip to content

feat: adding agents back to the experimental repo #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Jul 14, 2025

Conversation

davidsbatista
Copy link
Contributor

@davidsbatista davidsbatista commented Jun 17, 2025

Proposed Changes:

  • Adding agents code from haystack main core + the breakpoints logic (already reviewed in a sub-branch)

Checklist

@davidsbatista davidsbatista requested a review from a team as a code owner June 17, 2025 08:54
@davidsbatista davidsbatista requested review from Amnah199 and removed request for a team June 17, 2025 08:54
@coveralls
Copy link

coveralls commented Jun 17, 2025

Pull Request Test Coverage Report for Build 16221580855

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 46 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-5.4%) to 83.23%

Files with Coverage Reduction New Missed Lines %
core/pipeline/pipeline.py 18 80.77%
core/pipeline/breakpoint.py 28 73.28%
Totals Coverage Status
Change from base Build 16208756754: -5.4%
Covered Lines: 1876
Relevant Lines: 2254

💛 - Coveralls

@davidsbatista
Copy link
Contributor Author

This is acting like a feature branch, I open the following branches/PR against this one:

davidsbatista and others added 16 commits June 23, 2025 18:16
* initial import

* formating and renaming file

* solving shadowing issues

* solving shadowing issues

* solving formating issues

* adding type annotation

* adding visit count to Tool

* updating AgentBreakpoint

* removing whitespace

* renaming shadow variable names

* improving eq in ToolBrekapoint
* adding agents back to the experimental repo

* wip: adding breakpoints PoC to Agents

* wip

* typing

* formatting

* pylint issues

* fix typing

* reverting pyproject.toml

* fixing bug in component_visits

* linting

* adding/fixing tests

* all tests fixed

* cleaning up

* adding breakpoints to async version

* cleaning up

* refactoring tests

* adding more tests

* cleaning up

* formating issues

* typing

* cleaning

* adding async tests

* nit

* refactoring breakpoints logic to avoid duplicated code

* converting to staticmethod

* updating Agent + tests to use Breakpoint datastrcutures

* updating async tests to use Breakpoint datastrcutures

* refactoring tests

* refactoring tests

* wip: Pipeline accepting Breakpoint and Agentbreakpoint

* Pipeline accepting Breakpoint and Agentbreakpoint + fixing tests

* fix validate_input issue

* updating tests

* wip: adding breakpoints PoC to Agents

* WIP: testing breakpoints in agent within a pipeline

* wip: adding test for multiple breakpoints in Agent and Pipeline

* wip: adding test for multiple breakpoints in Agent and Pipeline

* adding tests for agent in pipeline

* nit

* reverting validate

* fixing agent in pipeline tests

* Update haystack_experimental/components/agents/agent.py

Co-authored-by: Sebastian Husch Lee <[email protected]>

* having one single BreakpointExecption

* parameters

* wip: fixing async tests

* nit: cleaning

* fixing imports

* reverting back to a single Breakpoint

* updating all tests due to reverting back to a single Breakpoint

* updating all tests due to reverting back to a single Breakpoint

* WIP: fixing tests

* updating tests without break_on_first and properly catching all the execptions

* updating integratiosn tests, reverting back to a single break point

* enabling back linter rules

* wip: resuming a pipeline agent, saving agent_name to state

* cleaning up

* all tests passing - working on pipeline agent resume from state

* updating tests to consider mandatory agent_name when having an Agent breakpoint

* serialisation with success of the pipeline where the agent is running plus the agent status serialisations into the the same resume JSON file

* updating linting and types due to new changes

* updating all tests due to new changes

* resuming an Agent within a pipeline

* replacing Path by PosixPath for Windows compatability

* reverting back to Path

* wip

* cleaning up - small improvments

* cleaning up validate pipeline

* simplifying the save state

* reducing parameters for save_state agent case

* saving all the main pipeline data nested under a single key

* more cleaning and small improvments

* helper function to handle the processing the state of  the host pipeline where agent is running

* helper function to handle file saving

* adding tests for agent in pipeline break and resume on a tool

* refactoring pipeline.run

* refactoring pipeline methods

* removing hard-coded path for JSON resume files, using pytest tmpfile

* wip

* review commments/improvments

* review commments/improvments + updating tests

* Fix validate_breakpoint

* moving static methods to breakpoint.py

* Update haystack_experimental/core/pipeline/pipeline.py

Co-authored-by: Amna Mubashar <[email protected]>

* fixing LICENSE header in breakpoint.py

* Update haystack_experimental/dataclasses/breakpoints.py

Co-authored-by: Sebastian Husch Lee <[email protected]>

* Small changes

* wip

* attending PR comments

* attending PR comments

* homogenization of var names and function names

---------

Co-authored-by: Sebastian Husch Lee <[email protected]>
Co-authored-by: Amna Mubashar <[email protected]>
Co-authored-by: Sebastian Husch Lee <[email protected]>
@davidsbatista davidsbatista requested a review from sjrl July 11, 2025 13:46
@davidsbatista
Copy link
Contributor Author

davidsbatista commented Jul 11, 2025

@sjrl @Amnah199 this is the same PR as before - the difference is that the whole Agents code is here - this one is being open against main

@davidsbatista davidsbatista merged commit 1c7bd91 into main Jul 14, 2025
8 checks passed
@davidsbatista davidsbatista deleted the adding-agent-code-from-haystack-main branch July 14, 2025 07:56
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.

3 participants