Fix: Restore visibility of tool execution output #329
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes three issues:
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 toLogLevel.info
, which is lower in the hierarchy.Interactive mode (
-i
flag) was causing a TypeError because it was trying to replaceprocess.stdout
, which in newer Node.js versions has only a getter.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:
emitMessages
method to properly respect log level (it was incorrectly checking againstLogLevel.debug
instead of the configured log level)For the interactive mode issue:
process.stdout
in the interactive input functionalityFor the agentDone formatting issue:
Testing
Tested by:
Running the CLI with the default log level and confirming that tool execution output is now visible:
Running in interactive mode and confirming no TypeError occurs:
Confirming that the tool completion message now correctly shows the result string instead of "[object Object]"
Related Issues
Fixes #328