Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MCP timeouts to be recoverable #1100

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jasonkneen
Copy link

@jasonkneen jasonkneen commented Feb 5, 2025

Fixes #1075

Add timeout and cancellation handling for long running commands in Goose MCP.

  • Modify crates/goose-cli/src/commands/session.rs to add a timeout mechanism using tokio::time::timeout in the agent_process_messages function and implement cancellation notifications to interrupt long running commands.
  • Add a cancel method to McpService in crates/mcp-client/src/service.rs to send cancellation notifications.
  • Modify crates/goose-cli/src/commands/mcp.rs to add logic to handle cancellation notifications and interrupt long running commands in the run_server function.
  • Modify crates/goose-server/src/commands/mcp.rs to add logic to handle cancellation notifications and interrupt long running commands in the run function.

For more details, open the Copilot Workspace session.

Fixes block#1075

Add timeout and cancellation handling for long running commands in Goose MCP.

* Modify `crates/goose-cli/src/commands/session.rs` to add a timeout mechanism using `tokio::time::timeout` in the `agent_process_messages` function and implement cancellation notifications to interrupt long running commands.
* Add a `cancel` method to `McpService` in `crates/mcp-client/src/service.rs` to send cancellation notifications.
* Modify `crates/goose-cli/src/commands/mcp.rs` to add logic to handle cancellation notifications and interrupt long running commands in the `run_server` function.
* Modify `crates/goose-server/src/commands/mcp.rs` to add logic to handle cancellation notifications and interrupt long running commands in the `run` function.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/block/goose/issues/1075?shareId=XXXX-XXXX-XXXX-XXXX).
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.

Goose MCP timeouts are not recoverable
1 participant