Skip to content

Capture log messages from agent and its immediate tools in AgentTracker output #325

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 3 commits into from
Mar 18, 2025

Conversation

bhouston
Copy link
Member

Capture log messages from agent and its immediate tools in AgentTracker output

This PR implements the functionality to capture log messages from an agent and its immediate tools (at log, warn, and error levels) and include them in the output returned by the agentMessage tool.

Changes

  • Added a log listener in agentStart.ts that captures log, warn, and error level messages from the agent and its immediate tools
  • Filtered logs based on nesting level to avoid capturing logs from deeper nested tools
  • Updated agentMessage.ts to include the captured logs in the output with a clear section header
  • Added comprehensive tests to verify the log capturing functionality

Testing

  • Added a new test file (logCapture.test.ts) that verifies:
    • Only logs at the specified levels (log, warn, error) are captured
    • Only logs from the immediate agent and its direct child tools are captured
    • Logs from deeper nested tools are not captured
    • Logs are properly formatted with prefixes based on log level

Related Issues

Fixes #324

@bhouston bhouston merged commit 86a4f30 into main Mar 18, 2025
0 of 2 checks passed
Copy link

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

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version mycoder-v1.5.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.

Capture log messages from agent and its immediate tools in AgentTracker output
1 participant