Update mcp.rs, use timeout for find_on_path#778
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bec42980cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let output = match tokio::time::timeout( | ||
| Duration::from_secs(3), | ||
| tokio::task::spawn_blocking(move || cmd.output()) | ||
| ).await { |
There was a problem hiding this comment.
Make the PATH lookup compile before using timeout
This adds .await inside find_on_path, but the function is still synchronous and its callers (runtime_binary_candidates/find_mcp_runtime) are synchronous, so the Rust build fails anywhere this module is compiled. The new code also uses Duration without importing it, but even with that fixed this .await needs an async call chain or a synchronous timeout implementation.
Useful? React with 👍 / 👎.
|
my case here is that i have a broken bashrc which looped and stuck. But my daily using shell is zsh. find_in_user_shell tries bash and therefore stuck forever |
find_on_path calls external command, which may hang or takes really long time. add time out wrap to avoid infinite waiting