-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Labels
Description
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
, andBrowserTracker
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