feat: add waitTimeout option to executeTerminalCommand - #405
Conversation
WalkthroughAdds an optional per-step ChangesTerminal Wait Timeout Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/public/demo-time.schema.json (1)
1300-1304: ⚡ Quick winConsider adding a minimum constraint to prevent confusing values.
The
waitTimeoutdefinition lacks aminimumconstraint. Other numeric fields in this schema (likehighlightBlurat lines 1343-1348 andhighlightOpacityat lines 1350-1357) includeminimumandmaximumvalidation. Without a minimum, users could provide negative or zero values, which would cause immediate timeout and confusing behavior. A minimum of 0 or 1 would prevent this edge case.📋 Suggested schema constraint
"waitTimeout": { "type": "number", "default": 5000, + "minimum": 0, "title": "Maximum time in milliseconds to wait for shell integration to confirm command completion. Overrides the default 5000ms cap. Useful for long-running commands such as builds or test suites." },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/public/demo-time.schema.json` around lines 1300 - 1304, The waitTimeout numeric schema (symbol: waitTimeout) lacks a minimum constraint, allowing zero/negative values that cause immediate timeout; update the demo-time.schema.json definition for waitTimeout to include a minimum (e.g., "minimum": 1) to prevent zero/negative inputs and keep it consistent with other numeric fields that have minimum/maximum validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@docs/public/demo-time.schema.json`:
- Around line 1300-1304: The waitTimeout numeric schema (symbol: waitTimeout)
lacks a minimum constraint, allowing zero/negative values that cause immediate
timeout; update the demo-time.schema.json definition for waitTimeout to include
a minimum (e.g., "minimum": 1) to prevent zero/negative inputs and keep it
consistent with other numeric fields that have minimum/maximum validation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 167bd0d3-e716-4802-aa40-1d3e3c97162b
📒 Files selected for processing (3)
apps/vscode-extension/src/services/TerminalService.tsdocs/public/demo-time.schema.jsonpackages/common/src/models/Demos.ts
Adds an optional `waitTimeout` parameter to `executeTerminalCommand` steps that lets users override the default 5-second shell-integration wait cap. Existing steps without `waitTimeout` continue to use the 5000ms default, making the change fully backward-compatible.
964d868 to
bd022d6
Compare
|
|
@88871 can you change it to the |



Closes #400
Adds an optional
waitTimeoutparameter toexecuteTerminalCommandsteps that lets users override the default 5-second shell-integration wait cap.Usage:
{ "command": "cargo build", "waitTimeout": 30000 }Defaults to 5000ms so all existing demos are unaffected.
Changes:
packages/common/src/models/Demos.ts— addedwaitTimeout?: numbertoITerminalinterface (whichStepextends)apps/vscode-extension/src/services/TerminalService.ts— destructurewaitTimeoutfrom the step and forward it towaitForTerminalExecuted;waitForTerminalExecutednow accepts an optionalmaxWaitTimeMsparameter (defaults to 5000)docs/public/demo-time.schema.json— addedwaitTimeoutproperty to theexecuteTerminalCommandaction block and a corresponding definition entrySummary by CodeRabbit
Note
Add
waitTimeoutoption toTerminalService.executeCommandfor shell integrationwaitTimeoutfield to theITerminalinterface and the terminal step JSON schema, allowing per-step override of the shell integration confirmation timeout.TerminalService.waitForTerminalExecutednow accepts an optionalmaxWaitTimeMsparameter, defaulting to the previous hardcoded 5000ms when omitted.waitTimeoutms (instead of always 5000ms) before proceeding; commands without awaitTimeoutset are unaffected.Macroscope summarized bd022d6.