-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add tool result message and error handling to LoggedToolCall #2647
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
base: main
Are you sure you want to change the base?
Conversation
…ndedLanguageModelToolResult
There was a problem hiding this 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, andhasErrorfields 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
toolResultErrorinExtendedLanguageModelToolResult
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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