- Notifications
You must be signed in to change notification settings - Fork1k
feat: add timeout support to workspace bash tool#19035
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
ThomasK33 merged 1 commit intomainfromthomask33/feat_add_timeout_support_to_workspace_bash_toolJul 28, 2025
Merged
feat: add timeout support to workspace bash tool#19035
ThomasK33 merged 1 commit intomainfromthomask33/feat_add_timeout_support_to_workspace_bash_toolJul 28, 2025
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
023275c
tof641d85
Comparehugodutka approved these changesJul 24, 2025
codersdk/toolsdk/bash_test.go Outdated
t.Run("ActualTimeoutBehavior",func(t*testing.T) { | ||
t.Parallel() | ||
// Test the specific scenario you described: echo "123"; sleep 60; echo "456" with 5s timeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Suggested change
//Test the specific scenario you described: echo "123"; sleep 60; echo "456" with 5s timeout | |
//Scenario: echo "123"; sleep 60; echo "456" with 5s timeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Ah yes, AI leaking through 😂
Approving barring the lint check |
Change-Id: I996cbde4a50debb54a0a95ca5a067781719fa25aSigned-off-by: Thomas Kosiewski <tk@coder.com>
f641d85
to00dd127
Compare398e80f
intomain 47 of 48 checks passed
Uh oh!
There was an error while loading.Please reload this page.
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
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.
Add timeout support to workspace bash tool
This PR adds a timeout feature to the workspace bash tool, allowing users to specify a maximum execution time for commands. Key changes include:
timeout_ms
parameter to control command execution time (defaults to 60 seconds, with a maximum of 5 minutes)executeCommandWithTimeout
function that properly handles command timeoutsWhen a command times out, the tool now returns all captured output up to that point along with a cancellation message, making it clear to users what happened.