Skip to content

Fix: Restore visibility of tool execution output #329

New issue

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

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

Already on GitHub? # to your account

Merged
merged 7 commits into from
Mar 18, 2025

Conversation

bhouston
Copy link
Member

@bhouston bhouston commented Mar 18, 2025

Description

This PR fixes three issues:

  1. Tool execution output was no longer visible by default when running the CLI. This occurred because tool execution logs were being emitted at LogLevel.log level, but the default log level was set to LogLevel.info, which is lower in the hierarchy.

  2. Interactive mode (-i flag) was causing a TypeError because it was trying to replace process.stdout, which in newer Node.js versions has only a getter.

  3. The agentDone tool was displaying "[object Object]" in its completion message instead of the actual result string, because it was trying to interpolate the entire output object instead of just the result property.

Changes

For the tool execution output issue:

  • Fixed the logger's emitMessages method to properly respect log level (it was incorrectly checking against LogLevel.debug instead of the configured log level)
  • Changed the default log level to 'log' in the configuration
  • Updated some tool execution logs to use info level instead of log level for better visibility

For the interactive mode issue:

  • Removed the attempt to replace process.stdout in the interactive input functionality
  • Updated the cleanup function accordingly

For the agentDone formatting issue:

  • Updated the logReturns function to correctly display the result property from the output object

Testing

Tested by:

  1. Running the CLI with the default log level and confirming that tool execution output is now visible:

    pnpm build && pnpm cli -f /tmp/test_prompt.txt
    
  2. Running in interactive mode and confirming no TypeError occurs:

    pnpm build && pnpm cli -i
    
  3. Confirming that the tool completion message now correctly shows the result string instead of "[object Object]"

Related Issues

Fixes #328

This commit adds the ability to send corrections to the main agent while it's running.
Key features:
- Press Ctrl+M during agent execution to enter correction mode
- Type a correction message and send it to the agent
- Agent receives and incorporates the message into its context
- Similar to how parent agents can send messages to sub-agents

Closes #326
The CLI was no longer showing tool execution output by default. This change:
1. Fixed the logger's emitMessages method to properly respect log level
2. Changed the default log level to 'log' in the configuration
3. Updated tool execution logs to use info level instead of log level

Fixes #328
The interactive mode was causing a TypeError because it was trying to replace
process.stdout, which in newer Node.js versions has only a getter.

This change:
1. Removes the attempt to replace process.stdout
2. Updates the cleanup function accordingly

Fixes interactive mode when using the -i flag
The agentDone tool was displaying "[object Object]" in its completion message
instead of the actual result string. This was because it was trying to
interpolate the entire output object instead of just the result property.

This change updates the logReturns function to correctly display the result
property from the output object.
@bhouston bhouston merged commit 26f1675 into main Mar 18, 2025
1 check failed
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 📦🚀

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

Successfully merging this pull request may close these issues.

Tool execution output not visible when running CLI
1 participant