Skip to content

Timeouts - #24

Merged
inercia merged 2 commits into
mainfrom
inercia/timeouts
Oct 19, 2025
Merged

Timeouts#24
inercia merged 2 commits into
mainfrom
inercia/timeouts

Conversation

@inercia

@inercia inercia commented Oct 19, 2025

Copy link
Copy Markdown
Owner

No description provided.

Signed-off-by: Alvaro Saurin <saurin@adobe.com>
@inercia
inercia requested a review from Copilot October 19, 2025 17:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 timeout field to the run configuration that accepts duration strings (e.g., "30s", "5m")
  • Implemented timeout enforcement using both Unix timeout command (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.

Comment thread pkg/command/command_exec.go Outdated
Comment thread docs/config.md Outdated
Comment thread docs/config.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@inercia
inercia merged commit 666c508 into main Oct 19, 2025
4 checks passed
@inercia
inercia deleted the inercia/timeouts branch October 19, 2025 17:33
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.

2 participants