feat: Add configurable timeout for command execution#5668
Conversation
- Add commandExecutionTimeout setting to VSCode configuration (1-300 seconds, default 30s) - Implement timeout logic in executeCommand function with proper cleanup - Add timeout status to CommandExecutionStatus type - Include comprehensive tests for timeout functionality - Abort running processes when timeout is reached - Provide clear timeout error messages to users Addresses Slack mention request for configurable command execution timeout.
|
✅ No security or compliance issues detected. Reviewed everything up to dcca042. Security Overview
Detected Code Changes
Reply to this PR with |
- Fixed fs.promises mocking in integration tests - Added proper abort method mocking for timeout scenarios - Increased test timeouts for async timeout testing - All timeout integration tests now pass successfully
|
@roomote-bot can you make it default to 0, meaning no timeout? And does this work for both terminal execution and execa execution? |
|
👋 Hi @mrubens! I've seen your comment and I'm working on it now. I'll:
I'll reply with a summary once the changes are complete! |
- Change default commandExecutionTimeout from 30000ms to 0 (no timeout) - Update minimum value from 1000ms to 0ms in package.json - Update package.nls.json description to clarify 0 = no timeout - Modify executeCommandTool.ts to skip timeout logic when timeout is 0 - Update tests to reflect new default behavior and add test for no timeout - Timeout functionality works for both VSCode terminal and execa execution Addresses @mrubens feedback in PR #5668
|
@roomote-bot can you change the timeout to be in seconds instead of milliseconds? And make it a max of 10 minutes? |
|
👋 Hi @mrubens! I've seen your comment and I'm working on it now. I'll change the timeout configuration from milliseconds to seconds with a maximum of 10 minutes (600 seconds). I'll reply with a summary once the changes are complete! |
- Update package.json configuration: max timeout now 600s (10 minutes) instead of 300000ms - Update package.nls.json description to reflect seconds unit - Update executeCommandTool.ts to convert seconds to milliseconds internally - Update error messages to display timeout in seconds - Update integration and unit tests to use seconds configuration - Maintain backward compatibility by converting seconds to milliseconds for internal timeout logic
|
@roomote-bot great! Can you translate the settings file into all languages using the Translate mode? |
|
👋 Hi @mrubens! I've seen your comment and I'm working on it now. I'll use the Translate mode to translate the settings file into all supported languages. I'll reply with a summary once the translations are complete! |
…uages - Added translations for commands.commandExecutionTimeout.description in 17 languages - Covers: ca, de, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW - All translations validated with missing-translations script
|
✅ Done! I've successfully translated the settings file into all supported languages using the Translate mode. Changes Made:
Translation Details:Each translation accurately conveys: "Maximum time in seconds to wait for command execution to complete before timing out (0 = no timeout, 1-600s, default: 0s)" Validation:
The new setting is now fully localized and ready for international users! |
| customCwd?: string | ||
| terminalShellIntegrationDisabled?: boolean | ||
| terminalOutputLineLimit?: number | ||
| commandExecutionTimeout?: number |
There was a problem hiding this comment.
Is this ever actually undefined? (Somewhat relatedly: is executeCommand just exported to make the tests easier, or am I missing a way it's being called?)
- Read commandExecutionTimeout from VSCode config in seconds - Convert to milliseconds internally for timeout logic - Display timeout in seconds in error messages - Update integration tests to expect seconds format
daniel-lxs
left a comment
There was a problem hiding this comment.
Not completely necessary but I think it would be a good idea to show some visual feedback if this setting is ever added to the settings menu.
LGTM
src/core/tools/executeCommandTool.ts
Outdated
| clineProvider?.postMessageToWebview({ type: "commandExecutionStatus", text: JSON.stringify(status) }) | ||
|
|
||
| // Add visual feedback for timeout | ||
| await cline.say("text", `Command execution timed out after ${commandExecutionTimeoutSeconds} seconds`) |
There was a problem hiding this comment.
Consider replacing the hardcoded timeout feedback message with a translatable key. Instead of using an inline fallback string in cline.say (i.e., Command execution timed out after ${commandExecutionTimeoutSeconds} seconds), use a proper translation key (e.g. t('commandExecutionTimeout')) to ensure UI consistency and proper localization.
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* main: fix: Resolve confusing auto-approve checkbox states (RooCodeInc#5602) fix: prevent empty mode names from being saved (RooCodeInc#5766) (RooCodeInc#5794) Format time in ISO 8601 (RooCodeInc#5793) fix: resolve DirectoryScanner memory leak and improve file limit handling (RooCodeInc#5785) Fix settings dirty check (RooCodeInc#5779) feat: increase Ollama API timeout values and extract as constants (RooCodeInc#5778) fix: Exclude Terraform and Terragrunt cache directories from checkpoints (RooCodeInc#4601) (RooCodeInc#5750) Move less commonly used provider settings into an advanced dropdown (RooCodeInc#5762) feat: Add configurable error & repetition limit with unified control (RooCodeInc#5654) (RooCodeInc#5752) list-files must include at least the first-level directory contents (RooCodeInc#5303) Update evals repo link (RooCodeInc#5758) Feature/vertex ai model name conversion (RooCodeInc#5728) fix(litellm): handle baseurl with paths correctly (RooCodeInc#5697) Add telemetry for todos (RooCodeInc#5746) feat: add undo functionality for enhance prompt feature (fixes RooCodeInc#5741) (RooCodeInc#5742) Fix max_tokens limit for moonshotai/kimi-k2-instruct on Groq (RooCodeInc#5740) Changeset version bump (RooCodeInc#5735) Add changeset for v3.23.12 patch release (RooCodeInc#5734) Update the max-token calculation in model-params to use the shared logic (RooCodeInc#5720) Changeset version bump (RooCodeInc#5719) chore: add changeset for v3.23.11 patch release (RooCodeInc#5718) Add Kimi K2 model and better support (RooCodeInc#5717) Fix: Remove invalid skip-checkout parameter from GitHub Actions workflows (RooCodeInc#5676) feat: add Cmd+Shift+. keyboard shortcut for previous mode switching (RooCodeInc#5695) Changeset version bump (RooCodeInc#5708) chore: add changeset for v3.23.10 patch release (RooCodeInc#5707) Add padding to the index model options (RooCodeInc#5706) fix: prioritize built-in model dimensions over custom dimensions (RooCodeInc#5705) Update CHANGELOG.md Changeset version bump (RooCodeInc#5702) chore: add changeset for v3.23.9 patch release (RooCodeInc#5701) Tweaks to command timeout error (RooCodeInc#5700) Update contributors list (RooCodeInc#5639) feat: enable Claude Code provider to run natively on Windows (RooCodeInc#5615) feat: Add configurable timeout for command execution (RooCodeInc#5668) feat: add gemini-embedding-001 model to code-index service (RooCodeInc#5698) fix: resolve vector dimension mismatch error when switching embedding models (RooCodeInc#5616) (RooCodeInc#5617) fix: [5424] return the cwd in the exec tool's response so that the model is not lost after subsequent calls (RooCodeInc#5667) Changeset version bump (RooCodeInc#5670) chore: add changeset for v3.23.8 patch release (RooCodeInc#5669)
This PR adds a configurable timeout for command execution in the Roo Code VSCode extension, addressing the Slack mention request.
Key Changes:
Configuration:
Users can set: roo-cline.commandExecutionTimeout (in milliseconds)
Testing:
Fixes: Slack mention request for configurable command execution timeout
Important
Adds configurable command execution timeout to Roo Code VSCode extension with new setting, logic, and tests.
commandExecutionTimeoutsetting (0-600 seconds, default 0) topackage.jsonfor command execution timeout.executeCommandinexecuteCommandTool.tswith process abortion and error messages.CommandExecutionStatusinterminal.tsto include timeout status.executeCommandTimeout.integration.spec.tsfor timeout functionality tests.executeCommandTool.spec.tsto include timeout parameter tests.command_timeoutmessage to multiple locale files for timeout error feedback.This description was created by
for 680c783. You can customize this summary. It will automatically update as commits are pushed.