fix: 增加Deepwiki 的一次性链接模式#28
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the DeepWiki MCP connection logic to support both persistent ('keep-alive') and one-time ('close-after-query') connection modes. It introduces modular helper functions for managing MCP connections and adds comprehensive integration tests for the query functions and repository name mapping. The review feedback highlights two important reliability issues: a potential resource leak in the connection closing logic where the transport might not be closed if the client is null, and a race condition in the global connection teardown that could leave a connection open if it is still being established when the close command is issued.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the DeepWiki MCP connection management to support both persistent and transient connection modes, introducing helper functions for connection lifecycle management. The test suite is also expanded to cover repository name mapping and error handling. Key feedback includes ensuring thorough resource cleanup by explicitly closing the transport even if the client fails to close, adopting standard MCP error handling for tool calls by checking the isError property, and refining test assertions for better validation of failure states.
| expect( | ||
| result.documentation === null || typeof result.error === 'string', | ||
| ).toBe(true); |
No description provided.