Skip to content

Update mcp.rs, use timeout for find_on_path#778

Open
HernandoR wants to merge 11 commits into
refactoringhq:mainfrom
HernandoR:patch-1
Open

Update mcp.rs, use timeout for find_on_path#778
HernandoR wants to merge 11 commits into
refactoringhq:mainfrom
HernandoR:patch-1

Conversation

@HernandoR

Copy link
Copy Markdown

find_on_path calls external command, which may hang or takes really long time. add time out wrap to avoid infinite waiting

Copilot AI review requested due to automatic review settings May 30, 2026 02:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src-tauri/src/mcp.rs
let output = match tokio::time::timeout(
Duration::from_secs(3),
tokio::task::spawn_blocking(move || cmd.output())
).await {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@HernandoR

Copy link
Copy Markdown
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant