Skip to content

Remove Router component and refactor MainAgent to handle skills/services directly#144

Merged
talos-agent merged 1 commit intomainfrom
devin/1753927675-remove-router
Jul 31, 2025
Merged

Remove Router component and refactor MainAgent to handle skills/services directly#144
talos-agent merged 1 commit intomainfrom
devin/1753927675-remove-router

Conversation

@devin-ai-integration
Copy link
Contributor

Remove Router component and refactor MainAgent to handle skills/services directly

Summary

This PR completely removes the Router component from the Talos codebase and refactors MainAgent to manage skills and services directly. The Router was acting as an intermediary layer that is no longer needed - MainAgent now stores skills and services as direct attributes and accesses them through simple iteration patterns.

Key changes:

  • 🗑️ Deleted src/talos/core/router.py entirely
  • 🔄 Refactored MainAgent to store self.skills and self.services directly
  • 🔄 Updated skill/service access patterns from self.router.skills to self.skills
  • 🔧 Modified CLI components to not instantiate Router
  • Updated all test files to remove Router dependencies
  • 📚 Updated documentation to reflect new architecture

Review & Testing Checklist for Human

⚠️ This is a high-risk architectural change - please test thoroughly:

  • End-to-end functionality test: Run the Talos CLI (uv run talos) and verify that skills and services work correctly in interactive mode
  • Daemon mode verification: Test daemon mode (talos daemon) to ensure background operation works without Router
  • Skill execution validation: Create a test ticket using a skill (e.g., proposals) and verify the full lifecycle works
  • Memory and context building: Verify that context building (_build_context) correctly aggregates tickets from all skills
  • Search for missed references: Run grep -r "Router\|router" src/ to double-check no code references remain

Recommended test plan:

  1. Start interactive Talos session
  2. Try creating tickets with different skills
  3. Check ticket status functionality
  4. Verify memory operations work
  5. Test daemon mode briefly

Diagram

%%{ init : { "theme" : "default" }}%%
graph TD
    MainAgent["src/talos/core/main_agent.py<br/>MainAgent class"]:::major-edit
    RouterFile["src/talos/core/router.py<br/>(DELETED)"]:::deleted
    CLIMain["src/talos/cli/main.py"]:::minor-edit
    CLIDaemon["src/talos/cli/daemon.py"]:::minor-edit
    TestMain["tests/test_main_agent.py"]:::minor-edit
    TestPrompt["tests/test_prompt_concatenation.py"]:::minor-edit
    
    MainAgent -->|"removed router field"| RouterFile
    MainAgent -->|"added skills/services fields"| MainAgent
    CLIMain -->|"removed Router() instantiation"| MainAgent
    CLIDaemon -->|"removed Router() instantiation"| MainAgent
    TestMain -->|"updated assertions"| MainAgent
    TestPrompt -->|"removed Router import"| MainAgent

    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit  
        L3[Deleted]:::deleted
    end

    classDef major-edit fill:#90EE90
    classDef minor-edit fill:#ADD8E6
    classDef deleted fill:#FFB6C1
Loading

Notes

  • All lint checks (ruff), type checks (mypy), and unit tests (pytest) pass successfully
  • The functionality should be preserved - skills and services are accessed directly instead of through Router
  • Documentation has been updated across multiple files to reflect the new architecture
  • This change simplifies the codebase by removing an unnecessary abstraction layer

Session details:

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

…ces directly

- Remove Router class and all imports
- Update MainAgent to store skills and services directly
- Refactor _setup_router to _setup_skills_and_services
- Update CLI and daemon to not instantiate Router
- Fix all test files to remove Router references
- Update documentation to reflect new architecture
- All tests passing, lint and type checks clean

Co-Authored-By: talosgma@gmail.com <talosgma@gmail.com>
@devin-ai-integration devin-ai-integration bot force-pushed the devin/1753927675-remove-router branch from 41a7983 to 93cf3e7 Compare July 31, 2025 02:22
@talos-agent talos-agent merged commit 7381f97 into main Jul 31, 2025
3 checks passed
@talos-agent talos-agent deleted the devin/1753927675-remove-router branch July 31, 2025 02:24
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.

1 participant