Bug: Fix searcher_resp_queue not available sometimes
The graph may not be ready when we try to access it for the first time. Sometimes the code returned by LLM (gpt4o for example), especially the first line graph = WebSearchGraph(), has not been executed yet.
This PR adds a retry mechanism when accessing graph, which partly fixes issue #36 #17.
Thank you so much for your PR! I appreciate your contribution to the project.
I've reviewed the code and have a few comments and suggestions for improvement:
-
continueruns the risk of making theexecute_codefunction fall into a dead loop. By using raise without any arguments in the except block of funcrun_command, it will re-raise the caught exception, preserving the original traceback information.
Hi @liujiangning30, I'm not quite understand your comment, like
By using raise without any arguments in the except block of func run_command, it will re-raise the caught exception, preserving the original traceback information.
Are you suggesting to add a limit (like 5 times) of retry, then raise an exception?
Yes
Hi @liujiangning30, I'm not quite understand your comment, like
By using raise without any arguments in the except block of func run_command, it will re-raise the caught exception, preserving the original traceback information.
Are you suggesting to add a limit (like 5 times) of retry, then raise an exception?
我这边正好相反,我这边的case一直都获取不到结果,是因为python执行器的问题,而且建议上面加一个重试次数的限制!https://github.com/InternLM/MindSearch/issues/36