Skip to content

Conversation

@zhichli
Copy link
Member

@zhichli zhichli commented Dec 20, 2025

Enhance the LoggedToolCall and ExtendedLanguageModelToolResult classes to include a tool result message, error handling, and a flag indicating if an error occurred. This improves logging and error reporting capabilities.

depending on core PR microsoft/vscode#284549

Copilot AI review requested due to automatic review settings December 20, 2025 00:42
@zhichli zhichli self-assigned this Dec 20, 2025
@zhichli zhichli requested a review from roblourens December 20, 2025 00:42
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 20, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the logging infrastructure for tool calls by adding error handling capabilities and result messages to the LoggedToolCall and ExtendedLanguageModelToolResult classes. The changes enable better debugging and error reporting for AI tool interactions.

Key Changes:

  • Added toolResultMessage, toolResultError, and hasError fields to track tool execution results and errors
  • Updated logging methods to extract and display these new fields in both JSON and markdown formats
  • Extended the proposed VS Code API to include toolResultError in ExtendedLanguageModelToolResult

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/platform/requestLogger/node/requestLogger.ts Added optional fields to ILoggedToolCall interface for tool result message, error, and error flag
src/extension/vscode.proposed.chatParticipantPrivate.d.ts Extended ExtendedLanguageModelToolResult class with toolResultError field
src/extension/prompt/vscode-node/requestLoggerImpl.ts Implemented extraction and logging of new fields in LoggedToolCall class, updated toJSON and markdown rendering methods

result.push(`~~~`);
}

if (entry.toolResultMessage) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you going to parse this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it's just rendered as string in .copilotmd which seems fine to add.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants