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

Goose MCP timeouts are not recoverable #1075

Open
baxen opened this issue Feb 5, 2025 · 1 comment · May be fixed by #1100
Open

Goose MCP timeouts are not recoverable #1075

baxen opened this issue Feb 5, 2025 · 1 comment · May be fixed by #1100
Assignees

Comments

@baxen
Copy link
Collaborator

baxen commented Feb 5, 2025

Describe the bug
After a long running command in something like the developer toolkit, we get a timeout error and the session can't continue

To Reproduce
Steps to reproduce the behavior:

  1. Ask goose to run a command that won't ever finish
  2. Wait for it to timeout
  3. Try something new

Expected behavior
We should be able to recover after the timeout and resume.

Please provide following information:

  • OS & Arch: OSX
  • Interface: UI
  • Version: v1.0.4
  • Extensions enabled: Developer
  • Provider & Model: sonnet 3.5

Additional context
I believe the issue is that we do not actually interrupt the long running command in the MCP server after the timeout is hit in the client. I'm not sure if MCP has a way in the protocol to interrupt. So we might need to handle timeouts in the server instead, and sync them up with the client.

@baxen baxen self-assigned this Feb 5, 2025
@salman1993
Copy link
Collaborator

https://spec.modelcontextprotocol.io/specification/2024-11-05/basic/utilities/cancellation/

Either side can send a cancellation notification to indicate that a previously-issued request should be terminated. If client calls a tool thats long running, we can potentially keep track of it and cancel after some time

jasonkneen added a commit to jasonkneen/goose that referenced this issue Feb 5, 2025
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).
@jasonkneen jasonkneen linked a pull request Feb 5, 2025 that will close this issue
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 a pull request may close this issue.

2 participants