Skip to content

Conversation

@presstab
Copy link
Owner

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 Application class into a new, dedicated InputHandler class. 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:

  • More Reliable Research: The Research Agent is now more resilient. If it has trouble interpreting a response from the AI model, it will automatically retry once. If the issue persists, the agent will gracefully stop and provide a summary of the research completed so far, rather than failing abruptly.
  • Updated AI Models: The list of available models has been refreshed to include the latest offerings from OpenAI and Anthropic, such as the GPT-5 series, while removing older versions.
  • UI Polish: Several icons within the terminal user interface have been updated to ensure better visual consistency across different operating systems and terminal emulators.

A Closer Look at the Changes:

  • Code Refinements & Improvements:

    • Input Handling Refactoring: The agentic loop responsible for interpreting and executing natural language input has been moved from Application.process_input into a new InputHandler class. 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.
    • Research Agent Resilience: The ResearchAgent now 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.
    • Lazy Agent Loading: The jrdev.agents package now uses __getattr__ to lazy-load agents, improving startup time and code organization.
    • Minor Fixes:
      • A None check has been added in textual_ui.py to prevent potential errors when processing text events.
      • The web_search agent tool now handles empty or whitespace-only queries more gracefully.
  • Configuration Updates:

    • Model List Refresh: The model_list.json configuration has been significantly updated. Outdated models have been removed, and new models, including the GPT-5 series and latest Claude versions, have been added.
    • Default Profile Update: The hardcoded fallback model profiles have been updated from older models to gpt-5-mini to align with the new model list.
      Generated by JrDev AI using gemini-2.5-pro

- Move router agent orchestration from Application.process_input to new InputHandler.route method
- Add lazy import for CommandInterpretationAgent in agents/__init__.py
- Improve variable handling in agent_tools web_search and web_scrape_url functions
- Add comprehensive tests for InputHandler in tests/test_input_handler.py
…uard against None text in TUI

- research_agent now retries once if JSON parsing fails, summarising findings and aborting gracefully on repeated failure
- textual_ui skips printing when event.text is None to prevent downstream errors
…iants

- Removes deprecated Anthropic, OpenAI and OpenRouter models
- Adds new Claude Haiku 4.5, Sonnet 4.5 and Opus 4.1 entries
- Introduces GPT-5, GPT-5-mini and GPT-5-nano with updated pricing/context
- Replaces all profile mappings to use gpt-5-mini as the default model
- Upgrade OpenAI models from o4-mini and gpt-4.1 variants to gpt-5-mini
- Update Anthropic models to latest claude-sonnet-4-5 and claude-haiku-4-5 versions
- Standardize Qwen models to use qwen3-coder across all profiles
- Improve test isolation by configuring git environment to prevent external interference
Add pytest configuration to handle async test functions without external plugins. The implementation detects coroutine functions and runs them using asyncio.run, providing basic async testing capabilities similar to pytest-asyncio.
@presstab presstab merged commit 2a84928 into master Oct 23, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants