Timeouts - #24
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds timeout functionality to command execution across the codebase. The implementation allows users to specify maximum execution durations for tools, preventing commands from hanging indefinitely.
Key changes:
- Added
timeoutfield to the run configuration that accepts duration strings (e.g., "30s", "5m") - Implemented timeout enforcement using both Unix
timeoutcommand (when available) and Go's context-based timeout - Added comprehensive test coverage for timeout scenarios
Reviewed Changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/config/tools_config.go | Added Timeout field to MCPToolRunConfig struct |
| pkg/command/command.go | Added timeout field to CommandHandler and implemented timeout context wrapping in GetMCPHandler |
| pkg/command/command_exec.go | Implemented timeout wrapping using Unix timeout command with fallback to context-based timeout |
| pkg/config/tool.go | Renamed checkToolRequirements to CheckToolRequirements (exported) |
| pkg/config/tools_config_test.go | Updated test to use renamed CheckToolRequirements method |
| cmd/exe.go | Added tool requirements check before creating command handler |
| tests/exe/test_exe_timeout.yaml | Added test configuration for various timeout scenarios |
| tests/exe/test_exe_timeout.sh | Added test script validating timeout functionality |
| tests/runners/test_runner_sandbox_exec.yaml | Added sandbox-exec runner tests including timeout validation |
| tests/runners/test_runner_sandbox_exec.sh | Added test script for sandbox-exec runner with timeout checks |
| tests/run_tests.sh | Added new timeout and sandbox-exec tests to test suite |
| tests/README.md | Updated documentation to include new timeout and sandbox-exec tests |
| docs/config.md | Added documentation for the timeout configuration field |
| docs/config-runners.md | Added timeout examples and notes in runner documentation |
| examples/*.yaml | Added timeout configuration to all example tools (30s-60s based on operation type) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.