Skip to content

Decouple Agent Tracking from backgroundTools #292

@bhouston

Description

@bhouston

Decouple Agent Tracking from backgroundTools

Description

Currently, the backgroundTools tracker is used to track shell processes, browser sessions, and agents in a single implementation. This creates unnecessary coupling between these different types of tools. This issue proposes to refactor the agent tracking into its own dedicated tracker.

Proposed Changes

  1. Create a new AgentTracker class in packages/agent/src/tools/interaction/agentTracker.ts that will be responsible for tracking sub-agents
  2. Move agent-specific tracking logic from backgroundTools.ts to this new class
  3. Implement a new listAgents tool that uses the dedicated AgentTracker
  4. Update agentStart.ts and related tools to use the new tracker instead of backgroundTools
  5. Remove agent-related code from backgroundTools.ts

Technical Details

  • The new AgentTracker should work alongside the existing agentStates map to provide status tracking
  • It should provide methods for registering, updating, and retrieving agent status
  • The listAgents tool should have similar filtering capabilities as listBackgroundTools but focused only on agents
  • The implementation should maintain backward compatibility where possible

Benefits

  • Reduced coupling between different tool types
  • More focused and maintainable code
  • Easier to extend or modify agent-specific functionality
  • Clearer separation of concerns

Acceptance Criteria

  • AgentTracker class is implemented
  • listAgents tool is implemented
  • agentStart.ts and related tools are updated to use the new tracker
  • Agent-specific code is removed from backgroundTools.ts
  • All tests pass
  • Documentation is updated

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions