Feature/usage fix#10
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR simplifies the agent pipeline and UI state management by removing legacy code paths, refine intent detection, and complex state tracking. The agent now relies on conversation history for natural follow-up handling, and tool exclusion logic is centralized through AgentState.
Key changes:
- Removed complex refine intent detection system and associated legacy functions (
is_refine_intent(),strip_refine_keywords(),_REFINE_KEYWORDS) - Simplified UI state by removing 3 state variables (
last_task_state,last_suggestions_state,excluded_names) and reducing handler parameters from 8 to 6 - Centralized tool exclusion through
AgentState.excluded_toolsfield, ensuring follow-up requests properly exclude already-recommended tools
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/full_test.py | Removed entire legacy test file that only tested the deprecated recommend_and_link() method |
| src/ai_agent/utils/utils.py | Fixed URL extraction to safely handle both list and string URL formats |
| src/ai_agent/utils/tags.py | Removed dead refine intent detection functions (is_refine_intent(), strip_refine_keywords()) and constants |
| src/ai_agent/ui/app.py | Major simplification: removed refine logic, legacy state tracking, and USE_AGENT conditional; added conversation history support and proper clear button handling |
| src/ai_agent/retriever/software_doc.py | Removed dead code from field validator |
| src/ai_agent/generator/generator.py | Removed unused re import |
| src/ai_agent/catalog/sync.py | Comment documenting removed unused function |
| src/ai_agent/api/pipeline.py | Removed legacy recommend_and_link() method (~180 lines) and associated imports/logic that are now handled by the agent |
| src/ai_agent/agent/utils.py | Added excluded_tools field to AgentState for centralized exclusion management |
| src/ai_agent/agent/agent.py | Updated agent to merge explicit exclusions with state exclusions and properly log them; added conversation history parameter to run_agent() |
| CHANGELOG.md | Documented all changes following Keep a Changelog format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request simplifies the agent pipeline and UI state management by removing legacy code paths, dead functions, and complex intent detection logic. The agent now relies on conversation history for understanding follow-up requests, and all tool exclusion logic is centralized and passed through the agent state. Several outdated tests and unused state variables have also been removed. These changes improve maintainability, reduce code complexity, and enhance the agent's ability to handle alternative tool requests naturally.
Agent and UI simplification:
recommend_and_link()method inapi/pipeline.py, consolidating all tool selection through the agent. [1] [2] [3]handle_message()and eliminating tracking forlast_task_state,last_suggestions_state, andexcluded_names.USE_AGENTconditional, ensuring the agent-based pipeline is always used.State and exclusion management improvements:
excluded_toolstoAgentState, merging explicit exclusions with agent state, and ensuring exclusions are correctly passed and logged. [1] [2] [3]Legacy code and test cleanup:
is_refine_intent(),strip_refine_keywords(),_REFINE_KEYWORDS) fromutils/tags.py,_load_catalog()function, and outdated tests such astests/full_test.py.api/pipeline.py, further streamlining the codebase. [1] [2] [3]Bug fixes and UX improvements:
References: [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]