Extract LLMExecutionAgent from DocsSummarizer#2872
Extract LLMExecutionAgent from DocsSummarizer#2872blublinsky wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
3b223e0 to
554e498
Compare
|
/retest |
1 similar comment
|
/retest |
|
@blublinsky: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/retest |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Description
Motivation
DocsSummarizer had grown to 1115 lines, mixing prompt preparation/skill resolution/history handling with the low-level LLM streaming and tool execution loop. Splitting these concerns:
Summary
Extract the iterative LLM + tool-calling loop from DocsSummarizer into a standalone LLMExecutionAgent class using composition. Beyond the extraction, several methods were refactored to reduce complexity and improve readability — _process_tool_calls_for_round was split by extracting _execute_or_skip_tools, skill resolution logic was pulled into _resolve_skill, and the GeneratorExit traceback from LangChain's astream was eliminated by draining the generator instead of returning early. DocsSummarizer now focuses on orchestration (prompt, context, skills) and delegates the entire LLM execution loop to LLMExecutionAgent. Unit and integration tests were migrated to target LLMExecutionAgent directly, making them more focused and precise at the new class boundary.
Type of change
Related Tickets & Documents
https://redhat.atlassian.net/browse/OLS-2840
https://redhat.atlassian.net/browse/OLS-2840
Checklist before requesting a review
Testing