feat(plugin): implement on_pipeline_error_callback lifecycle hook#5988
feat(plugin): implement on_pipeline_error_callback lifecycle hook#5988mramansayyad wants to merge 1 commit into
Conversation
|
Response from ADK Triaging Agent Hello @mramansayyad, thank you for submitting this pull request! To help us review your contribution more efficiently, please ensure that it aligns with our contribution guidelines. Currently, the following items are missing from your PR description:
Providing this context will save time for the reviewers. Thank you for your cooperation! |
|
/adk-pr-analyze |
🔍 ADK Pull Request Analysis: PR #5988Title: feat(plugin): implement on_pipeline_error_callback lifecycle hook Executive Summary
Detailed Findings & Analysis1. Objectives & Impact ("What does it do?")
2. Justification & Value ("Is it a valid and useful change?")
3. Principle & Style Alignment Checklist ("Does it follow rules?")
|
4b27902 to
3453827
Compare
🔍 ADK Pull Request Analysis: PR #5988Title: feat(plugin): implement on_pipeline_error_callback lifecycle hook Executive Summary
Detailed Findings & Analysis1. Objectives & Impact ("What does it do?")
2. Justification & Value ("Is it a valid and useful change?")
3. Principle & Style Alignment Checklist ("Does it follow rules?")
Currently, the active local branch has been safely returned to |
|
Hello, I have updated the PR description to include the associated issue context, testing plan, and local test logs. Please let me know if any other changes are needed! Thank you. |
|
/adk-pr-analyze |
Description
This PR implements the
on_pipeline_error_callbacklifecycle hook onBasePluginandPluginManager, bringingadk-pythonto feature parity with the corresponding capabilities inadk-go.Associated Issue
This PR introduces the feature/parity capability directly without a separate GitHub issue, following the issue template structure below:
adk-pythondoes not expose a lifecycle hook to capture pipeline-level/runner-level errors across plugins. In contrast,adk-goprovideson_pipeline_error_callback, which allows plugins to clean up resources, rollback operations, or report/format errors before they propagate out.on_pipeline_error_callback(self, error: Exception, **kwargs) -> ExceptiontoBasePlugin.run_on_pipeline_error_callback(self, invocation_context: InvocationContext, error: Exception) -> ExceptioninPluginManagerto chain the error callbacks across registered plugins.runners.py) by wrapping the primary yield-loops intry...exceptblocks that invoke the pipeline error hook before re-raising or modifying the exception.Logs or Screenshots
Executing the unit tests verifies the correctness of the lifecycle hooks:
Testing Plan
A dedicated set of unit tests was added to
tests/unittests/plugins/test_plugin_manager.py:test_all_callbacks_are_supported: Verifieson_pipeline_error_callbackis registered and callable onPluginManager.test_pipeline_error_callback_chaining: Verifies that the exception is passed through the registered plugins sequentially and can be modified/returned.test_pipeline_error_callback_exception_wrap: Verifies that plugin callback failures are cleanly wrapped in aRuntimeErrorand propagated.How to Run the Tests
To verify locally, run the following command in the
adk-pythondirectory:Type of change
Checklist
CHANGELOG.md