Skip to content

Conversation

@StevenTCramer
Copy link
Contributor

@StevenTCramer StevenTCramer commented May 4, 2025

Context

This PR adds a log entry feature to Roo Code that allows the AI assistant to output debugging information to the VSCode output channel. Unlike tools, log entries don't require user approval and don't count toward the one-tool-per-message limit, making them ideal for diagnostic purposes.

Implementation

The implementation includes:

  1. Added a new log entry section to the system prompt that explains how to use log entries
  2. Created a log entry parser in the parseAssistantMessage function that handles both complete and partial log entries during streaming
  3. Defined log levels (debug, info, warn, error) with "info" as the default
  4. Added comprehensive tests to ensure log entry functionality works correctly
  5. Fixed an issue with log entry levels by only logging complete entries

The log entry feature follows a similar pattern to tool use but is simpler and doesn't require user approval. Log entries are formatted using XML-style tags:

<log_entry>
<message>Your log message here</message>
<level>info</level>
</log_entry>

Special attention was given to handling XML tags inside code blocks (triple backticks) to prevent false positives.

Screenshots

image

How to Test

  1. Start a new conversation with Roo
  2. Ask Roo to demonstrate log entries with different log levels
  3. Check the VSCode output channel (View > Output > Roo) to see the log entries
  4. Verify that log entries with different levels (debug, info, warn, error) appear with appropriate formatting
  5. Verify that log entries inside code blocks (triple backticks) are not processed as actual log entries

Get in Touch

Discord: StevenTCramer


Important

Adds a logging feature to Roo Code for sending diagnostic messages to the VSCode output channel using XML-style log entries without user approval.

  • Behavior:
    • Adds log entry feature to send diagnostic messages to VSCode output channel without user approval.
    • Log entries use XML-style tags and support levels: debug, info, warn, error.
    • Implemented in Cline.ts and LogManager.ts.
  • Parsing and Management:
    • parseAssistantMessage() in parse-assistant-message.ts updated to handle log entries.
    • New LogManager class in LogManager.ts for processing log entries.
  • Prompts and Schemas:
    • Adds getLogEntrySection() in log-entry.ts for system prompts.
    • Defines logLevels and logEntryParamsSchema in log-entry.ts.
  • Testing:
    • Comprehensive tests for log entry parsing in log-entry.test.ts.
    • Tests for LogManager in LogManager.test.ts.

This description was created by Ellipsis for b195811. You can customize this summary. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented May 4, 2025

🦋 Changeset detected

Latest commit: 3b29790

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
roo-cline Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@KJ7LNW
Copy link
Contributor

KJ7LNW commented May 5, 2025

Neat, but what is the use case?

@StevenTCramer
Copy link
Contributor Author

Neat, but what is the use case?

The use case is to allow for debugging of prompts specifically state machines and mermaid flow charts like boomerang. When asking an AI to follow a flow/state machine this gives the AI the ability to log where it is in the flow.

Example messages:
Entering State "Analyzing"
Data: {"ToolFailure": false }
Exiting State "Analyzing"
Entering State "ExecutingTool"

This allows the AI to "tell" us information about its following of our system prompts etc.

@StevenTCramer StevenTCramer force-pushed the Cramer/2025-05-04/Logging branch from f528472 to ea5f180 Compare May 5, 2025 16:20
@StevenTCramer StevenTCramer marked this pull request as ready for review May 5, 2025 16:32
@StevenTCramer StevenTCramer requested review from cte and mrubens as code owners May 5, 2025 16:32
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels May 5, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 5, 2025
@hannesrudolph hannesrudolph moved this from PR [Pre Approval Review] to New in Roo Code Roadmap May 5, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 5, 2025
@daniel-lxs
Copy link
Member

@StevenTCramer
Hey, the use case for this feature appears quite niche. Could this be achieved with an MCP? I understand that using an MCP no longer allows for bypassing the "one tool call per message" rule.

Given that allowing multiple tool calls in a single message has been a topic of discussion for quite some time, do you think allowing this specific tool along with others in a single API response could confuse the model and cause it to try to use multiple tools? Just allowing it for a single tool might not be ideal.

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Needs Review] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs
Copy link
Member

Hey @StevenTCramer,
Thank you for your contribution, We noticed this PR is stale and will be closed. If you plan to revisit this, please create an issue first as required by our issue-first approach before opening a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants