Refactor Input Handling and Improve Agent Robustness #147
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.
Overview: This pull request introduces a structural refactoring to the application's core input processing logic and enhances the resilience of the Research Agent. The primary change is the extraction of the natural language routing loop from the main
Applicationclass into a new, dedicatedInputHandlerclass. This improves separation of concerns, simplifies the application's main entry point, and enhances testability. Additionally, the Research Agent is now more robust against intermittent LLM failures, and the list of available models has been updated.What This Means for Users:
A Closer Look at the Changes:
Code Refinements & Improvements:
Application.process_inputinto a newInputHandlerclass. This change clarifies responsibilities within the application core and is accompanied by a new suite of unit tests (test_input_handler.py) for the extracted logic.ResearchAgentnow includes a retry mechanism. If it fails to parse the JSON response from the LLM, it will make a second attempt. If the second attempt also fails, it constructs a summary of the tool calls made up to that point and concludes the task, preventing a hard crash.jrdev.agentspackage now uses__getattr__to lazy-load agents, improving startup time and code organization.Nonecheck has been added intextual_ui.pyto prevent potential errors when processing text events.web_searchagent tool now handles empty or whitespace-only queries more gracefully.Configuration Updates:
model_list.jsonconfiguration has been significantly updated. Outdated models have been removed, and new models, including the GPT-5 series and latest Claude versions, have been added.gpt-5-minito align with the new model list.Generated by JrDev AI using gemini-2.5-pro