mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
Show stderr output from mcp servers in debug mode (#4049)
This commit is contained in:
@@ -166,6 +166,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
expect(mockConfig.getMcpServers).toHaveBeenCalledTimes(1);
|
||||
expect(mockConfig.getMcpServerCommand).toHaveBeenCalledTimes(1);
|
||||
@@ -196,6 +197,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(parse).toHaveBeenCalledWith(commandString, process.env);
|
||||
@@ -243,6 +245,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(StdioClientTransport).toHaveBeenCalledWith({
|
||||
@@ -282,6 +285,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(SSEClientTransport).toHaveBeenCalledWith(
|
||||
@@ -325,6 +329,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
return { serverConfig };
|
||||
@@ -388,6 +393,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(StreamableHTTPClientTransport).toHaveBeenCalledWith(
|
||||
@@ -431,6 +437,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
return { serverConfig };
|
||||
@@ -542,6 +549,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(mockToolRegistry.registerTool).toHaveBeenCalledTimes(3);
|
||||
@@ -610,6 +618,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(mockToolRegistry.registerTool).toHaveBeenCalledTimes(1);
|
||||
@@ -644,6 +653,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
),
|
||||
).rejects.toThrow('Parsing failed');
|
||||
expect(mockToolRegistry.registerTool).not.toHaveBeenCalled();
|
||||
@@ -658,6 +668,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(console.error).toHaveBeenCalledWith(
|
||||
@@ -683,6 +694,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(console.error).toHaveBeenCalledWith(
|
||||
@@ -708,6 +720,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(console.error).toHaveBeenCalledWith(
|
||||
@@ -732,6 +745,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
const clientInstances = vi.mocked(Client).mock.results;
|
||||
@@ -782,6 +796,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(mockToolRegistry.registerTool).toHaveBeenCalledTimes(2);
|
||||
@@ -809,6 +824,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(mockToolRegistry.registerTool).toHaveBeenCalledTimes(2);
|
||||
@@ -835,6 +851,7 @@ describe('discoverMcpTools', () => {
|
||||
mockConfig.getMcpServers() ?? {},
|
||||
mockConfig.getMcpServerCommand(),
|
||||
mockToolRegistry as any,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(mockToolRegistry.registerTool).toHaveBeenCalledTimes(1);
|
||||
|
||||
Reference in New Issue
Block a user