feat: working agent management #626
Merged
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.
Purpose
This pull request introduces significant updates to the application's agent management and logging mechanisms, as well as improvements to SQL query handling and error management. The changes primarily focus on adding support for a new SQL agent, enhancing logging for debugging purposes, and improving cleanup processes during application shutdown and agent deletion.
Agent Management Enhancements:
src/App/app.py: Added initialization and cleanup logic for a new SQL agent during application startup and shutdown. Improved error handling and logging during the shutdown process to ensure agents are properly cleaned up.src/App/backend/agents/agent_factory.py: Introduced a new_sql_agentattribute inAgentFactoryand implemented methods to initialize and delete the SQL agent. Added detailed logging and error handling during agent deletion for wealth advisor, search, and SQL agents. [1] [2]Logging Improvements:
src/App/backend/agents/agent_factory.py: Enhanced logging to provide detailed information about agent initialization and deletion processes, including warnings for invalid or missing agent clients.src/App/backend/plugins/chat_with_data_plugin.py: Added logging for SQL query generation, execution, and result processing, as well as thread cleanup after query execution. [1] [2] [3]SQL Query Handling:
src/App/backend/plugins/chat_with_data_plugin.py: Improved SQL query generation and cleanup logic, ensuring queries are properly formatted and executed. Added logging to track query results and provide previews of the output.Application Context Updates:
src/App/backend/plugins/chat_with_data_plugin.py: Updated logic to use the singleton search agent from the application context when available, falling back toAgentFactoryif necessary.Codebase Maintenance:
src/App/backend/agents/agent_factory.py: Addedloggingimport to enable detailed logging throughout the agent factory module.src/App/backend/plugins/chat_with_data_plugin.py: Addedcurrent_appimport to access application context for agent management.Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information