mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
fix mcp timeouts and missing description on mcp errors (#868)
This commit is contained in:
@@ -249,10 +249,8 @@ export function mapToDisplay(
|
||||
trackedCall.request.args,
|
||||
);
|
||||
renderOutputAsMarkdown = currentToolInstance.isOutputMarkdown;
|
||||
}
|
||||
|
||||
if (trackedCall.status === 'error') {
|
||||
description = '';
|
||||
} else if ('request' in trackedCall && 'args' in trackedCall.request) {
|
||||
description = JSON.stringify(trackedCall.request.args);
|
||||
}
|
||||
|
||||
const baseDisplayProperties: Omit<
|
||||
|
||||
@@ -924,7 +924,7 @@ describe('mapToDisplay', () => {
|
||||
expectedStatus: ToolCallStatus.Error,
|
||||
expectedResultDisplay: 'Error display tool not found',
|
||||
expectedName: baseRequest.name,
|
||||
expectedDescription: '',
|
||||
expectedDescription: JSON.stringify(baseRequest.args),
|
||||
},
|
||||
{
|
||||
name: 'error tool execution failed',
|
||||
@@ -940,7 +940,7 @@ describe('mapToDisplay', () => {
|
||||
expectedStatus: ToolCallStatus.Error,
|
||||
expectedResultDisplay: 'Execution failed display',
|
||||
expectedName: baseTool.displayName, // Changed from baseTool.name
|
||||
expectedDescription: '',
|
||||
expectedDescription: baseTool.getDescription(baseRequest.args),
|
||||
},
|
||||
{
|
||||
name: 'cancelled',
|
||||
@@ -986,14 +986,7 @@ describe('mapToDisplay', () => {
|
||||
expect(toolDisplay.resultDisplay).toBe(expectedResultDisplay);
|
||||
|
||||
expect(toolDisplay.name).toBe(expectedName);
|
||||
|
||||
if (status === 'error' && !extraProps?.tool) {
|
||||
expect(toolDisplay.description).toBe('');
|
||||
} else {
|
||||
expect(toolDisplay.description).toBe(
|
||||
expectedDescription ?? baseTool.getDescription(baseRequest.args),
|
||||
);
|
||||
}
|
||||
expect(toolDisplay.description).toBe(expectedDescription);
|
||||
|
||||
expect(toolDisplay.renderOutputAsMarkdown).toBe(
|
||||
extraProps?.tool?.isOutputMarkdown ?? false,
|
||||
|
||||
Reference in New Issue
Block a user