Fix run_in_terminal timeout signaling and avoid foreground reuse after timeout#302892
Merged
meganrogge merged 4 commits intomainfrom Mar 18, 2026
Merged
Fix run_in_terminal timeout signaling and avoid foreground reuse after timeout#302892meganrogge merged 4 commits intomainfrom
meganrogge merged 4 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves run_in_terminal timeout handling so that when a model-supplied timeout is hit, the tool explicitly signals the timeout (in text + metadata) and prevents the timed-out terminal from being reused as the foreground session terminal.
Changes:
- Updates the tool schema wording to clarify that timeouts return partial output with a timeout indicator.
- Adds an explicit “timeout” outcome to the foreground execution race and returns partial output + timeout metadata.
- On timeout, marks the terminal as background and detaches it from foreground session reuse to reduce output pollution on later runs.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
bpasero
approved these changes
Mar 18, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix #299486
When run_in_terminal hit a model-provided timeout, it could return partial output without clearly indicating timeout, which could mislead agents and cause confusing follow-up output behavior.
Now:
This allows agents to reliably detect timed-out executions, and subsequent foreground runs are less likely to be polluted by timed-out command output.
cc @Tyriar