Skip to content

Conversation

bhouston
Copy link
Member

Decouple Browser Session Tracking from backgroundTools

Description

This PR implements the changes requested in issue #291 to decouple browser session tracking from the backgroundTools class. It creates a dedicated BrowserTracker class to handle browser session tracking separately.

Changes

  1. Created a new BrowserTracker class in packages/agent/src/tools/browser/browserTracker.ts
  2. Moved browser-specific tracking logic from backgroundTools.ts to this new class
  3. Implemented a new listBrowsers tool that uses the dedicated BrowserTracker
  4. Updated browseStart.ts and browseMessage.ts to use the new tracker instead of backgroundTools
  5. Removed browser-related code from backgroundTools.ts
  6. Updated tests to reflect the decoupled implementation

Benefits

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

Testing

All tests pass after the changes. The implementation maintains backward compatibility.

Fixes #291

- Fixed type errors in browser tracker implementation

- Updated tests to remove browser-related code from backgroundTools tests

- Added default agent name for browser tracker tools
@bhouston
Copy link
Member Author

This has been merged via a different PR.

@bhouston bhouston closed this Mar 18, 2025
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.

Decouple Browser Session Tracking from backgroundTools
1 participant