Skip to content

Refactor: Replace background tools with scoped resource trackers #305

@bhouston

Description

@bhouston

Refactor: Replace background tools with scoped resource trackers

Description

This refactoring removes the global background tools approach and replaces it with individual resource trackers (AgentTracker, ShellTracker, and BrowserTracker) that are scoped to each agent instance. This improves encapsulation and resource management by ensuring that each agent is responsible for its own resources.

Changes

  • Remove backgroundTools.ts and related files
  • Refactor individual resource trackers to be scoped to the agent rather than global
  • Update AgentTracker, ShellTracker, and BrowserTracker to include owner agent ID
  • Add cleanup methods to each tracker to properly terminate resources
  • Remove listBackgroundTools in favor of individual resource listing tools
  • Update tool implementations to use the new trackers

Benefits

  • Better resource isolation and management
  • Clearer ownership of resources (shells, browsers, sub-agents)
  • Improved cleanup process when agents terminate
  • More maintainable and modular code structure

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