Skip to content

feat: implement background tool tracking (issue #112) #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 12, 2025

Conversation

bhouston
Copy link
Member

Implement Background Tool Tracking (Issue #112)

Description

This PR implements a background tool tracking system that allows agents to see which background tools (shells, browsers, and in the future, agents) are running. This makes it easier for agents to manage and coordinate background processes effectively.

Implementation Details

  • Added a central BackgroundToolRegistry in packages/agent/src/core/backgroundTools.ts
  • Created a new listBackgroundTools tool that returns information about running background processes
  • Modified existing tools (shellStart, shellMessage, browseStart, browseMessage) to register with the registry
  • Added process isolation so each agent only sees its own processes
  • Added comprehensive tests for the new functionality

Key Features

  • Track shell processes started with shellStart
  • Track browser sessions started with browseStart
  • Monitor process status (running, completed, error, terminated)
  • Track runtime information for each process
  • Automatically clean up old completed processes
  • Process isolation between different agents

Testing

  • Added unit tests for the background tool registry
  • Added tests for the listBackgroundTools tool
  • All tests are passing

How to Use

Agents can now use the listBackgroundTools tool to see which background tools are running:

// List all background tools
const result = await listBackgroundTools({});

// Filter by status
const runningTools = await listBackgroundTools({ status: 'running' });

// Filter by type
const browserTools = await listBackgroundTools({ type: 'browser' });

// Get detailed metadata
const verboseList = await listBackgroundTools({ verbose: true });

Related Issues

Closes #112

@bhouston bhouston merged commit 792c58f into main Mar 12, 2025
1 check passed
Copy link

🎉 This PR is included in version mycoder-agent-v1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Background Tool Tracking
1 participant