Skip to content

Add enforceModelTimeout setting#286607

Merged
Tyriar merged 2 commits intomainfrom
tyriar/286598
Jan 8, 2026
Merged

Add enforceModelTimeout setting#286607
Tyriar merged 2 commits intomainfrom
tyriar/286598

Conversation

@Tyriar
Copy link
Copy Markdown
Contributor

@Tyriar Tyriar commented Jan 8, 2026

Fixes #286598

image

@Tyriar Tyriar added this to the January 2026 milestone Jan 8, 2026
@Tyriar Tyriar requested a review from meganrogge January 8, 2026 19:56
@Tyriar Tyriar self-assigned this Jan 8, 2026
Copilot AI review requested due to automatic review settings January 8, 2026 19:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 a new experimental setting chat.tools.terminal.enforceTimeoutFromModel to enable timeout enforcement for terminal commands executed via the run-in-terminal tool. When enabled, the model can specify a timeout duration for commands, and the tool will stop tracking after that duration and return partial output.

Key changes:

  • Added EnforceTimeoutFromModel configuration setting as an experimental feature
  • Extended the tool schema to include a required timeout parameter
  • Implemented timeout handling that cancels command execution and returns partial output when timeout is reached

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.ts Adds new experimental setting EnforceTimeoutFromModel with boolean type, defaulting to false
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts Adds timeout parameter to tool schema, implements timeout enforcement logic with cancellation and partial output collection
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts:232

  • The timeout parameter is marked as 'required' in the tool schema, but it's defined as optional in the IRunInTerminalInputParams interface with 'timeout?:'. This inconsistency means the model must always provide a timeout value, but the code treats it as optional. Either remove 'timeout' from the required array, or change the interface to make it non-optional (timeout:).
			required: [
				'command',
				'explanation',
				'isBackground',
				'timeout',

Copy link
Copy Markdown
Collaborator

@meganrogge meganrogge left a comment

Choose a reason for hiding this comment

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

I'm slightly worried about giving this control over to the model, but 🤷🏼‍♀️ we shall see!

@Tyriar Tyriar merged commit b17ee43 into main Jan 8, 2026
27 of 28 checks passed
@Tyriar Tyriar deleted the tyriar/286598 branch January 8, 2026 20:16
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Feb 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timeout parameter on terminal tool

3 participants