Skip to content

feat: add component lifecycle handling#11675

Open
anakin87 wants to merge 13 commits into
v3from
lifecycle
Open

feat: add component lifecycle handling#11675
anakin87 wants to merge 13 commits into
v3from
lifecycle

Conversation

@anakin87

@anakin87 anakin87 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Related Issues

Proposed Changes:

Discussed in https://github.com/deepset-ai/haystack-private/issues/384#issuecomment-4740431488

How did you test it?

  • CI, new tests
  • opened a PR on core integrations to spot issues in the inheriting components from touched OpenAI components: try lifecycle Haystack branch haystack-core-integrations#3467
    • several failures, also unrelated (I think we should start testing v3 branch soon on core integrations)
    • took a look at failures related to modified OpenAI components: I think we might fix them with some if/else to temporarily be compatible with Haystack 2.x and 3.x
  • also tried to implement the new lifecycle handling approach to other integrations (Bedrock, Nvidia and Sentence Transformers) to see if it holds and it turned out to be feasible

Notes for the reviewer

This PR is big. I created a single one to test everything.
Once we agree on the general approach, I'd be happy to split it into smaller parts if you prefer.

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 Jun 18, 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 Preview Jun 19, 2026 11:06am

Request Review

@anakin87 anakin87 changed the base branch from main to v3 June 18, 2026 08:47
@github-actions github-actions Bot added the type:documentation Improvements on the docs label Jun 18, 2026
@github-actions

github-actions Bot commented Jun 18, 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/components/audio
  whisper_remote.py 187-190, 196-202
  haystack/components/embedders
  azure_document_embedder.py
  azure_text_embedder.py
  openai_document_embedder.py 250, 295-302, 375-379
  openai_text_embedder.py 221-223, 241-245
  haystack/components/evaluators
  llm_evaluator.py
  haystack/components/extractors
  llm_metadata_extractor.py
  haystack/components/extractors/image
  llm_document_content_extractor.py
  haystack/components/fetchers
  link_content.py 192-200, 267
  haystack/components/generators/chat
  azure.py 213
  fallback.py
  openai.py
  openai_responses.py
  haystack/components/preprocessors
  embedding_based_document_splitter.py
  recursive_splitter.py
  haystack/components/query
  query_expander.py
  haystack/components/rankers
  llm_ranker.py 320-321
  haystack/components/retrievers
  multi_query_embedding_retriever.py
  multi_query_text_retriever.py
  multi_retriever.py
  haystack/components/routers
  llm_messages_router.py
  haystack/core/pipeline
  base.py
  pipeline.py
  haystack/core/super_component
  super_component.py
Project Total  

The report is truncated to 25 files out of 27. To see the full report, please visit the workflow summary page.

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

@anakin87 anakin87 changed the title Lifecycle POC feat: add component lifecycle handling Jun 18, 2026
@anakin87 anakin87 marked this pull request as ready for review June 18, 2026 14:53
@anakin87 anakin87 requested a review from a team as a code owner June 18, 2026 14:53
@anakin87 anakin87 requested review from bogdankostic, mpangrazzi and sjrl and removed request for a team and bogdankostic June 18, 2026 14:53
Comment thread haystack/components/audio/whisper_remote.py
Comment thread haystack/core/pipeline/base.py Outdated
Comment thread haystack/core/pipeline/base.py Outdated
Comment thread test/components/agents/test_agent.py Outdated
Comment thread test/core/pipeline/test_pipeline_lifecycle.py Outdated
Comment thread test/core/pipeline/test_pipeline_lifecycle.py Outdated
@anakin87 anakin87 requested a review from a team as a code owner June 19, 2026 10:11
Comment thread haystack/components/agents/agent.py

@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! Would be nice if @mpangrazzi could also give it a lookover before merging

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants