run_in_terminal: promote sync command to background after idle silence#316166
Conversation
If a synchronous run_in_terminal call produces no output for N ms, win the foreground race with a new idleSilence candidate that mirrors the existing timeout handler: promote the execution to background, return the terminal ID + output collected so far, append a steering hint. The process is never killed. Gated on chat.tools.terminal.idleSilenceTimeoutMs (default 60000, 0 disables). Listener and scheduler are owned by the existing raceCleanup DisposableStore so they go away when another candidate wins. Async (waitStrategy === 'idle') path is unchanged. Fixes #315884
Replace the boolean mentionTimeout parameter on _buildInputNeededSteeringText with a 'none' | 'timeout' | 'idleSilence' discriminator so the idle-silence promotion result no longer reuses the timeout wording. Add focused unit tests covering each mode.
|
/requires-eval-assessment terminalbench2 gpt-5.4,claude-opus-4.6,claude-opus-4.7 |
|
⏳ Queued vscode build for
|
There was a problem hiding this comment.
Pull request overview
This PR extends the terminal chat agent “run in terminal” tool to support an idle-silence path: when a foreground/sync command produces no output for a configurable duration, the tool returns early, moves the execution to a background terminal, and provides updated steering guidance to the model.
Changes:
- Add a new configuration setting
chat.tools.terminal.idleSilenceTimeoutMsto control idle-silence promotion timing (0 disables). - Implement idle-silence promotion logic in
RunInTerminalTooland adjust input-needed steering text to distinguish'none' | 'timeout' | 'idleSilence'. - Add unit tests validating the steering text content across the new “hung hint” modes.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts | Adds tests for steering text behavior across none/timeout/idle-silence modes. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.ts | Introduces the new idleSilenceTimeoutMs setting with schema/description. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts | Implements idle-silence promotion and updates steering text API/call sites. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 2
|
Base:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
⏳ Queued vscode build for
|
Resolve conflict in runInTerminalTool.ts: keep idleSilence race type + try/finally cleanup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
⏳ Queued vscode build for
|
|
🚀 Queued eval-assessment publish build for
|
|
🔬 Queued eval-assessment benchmark for
Results will be posted back here when the run completes. |
|
✅ Eval-assessment build published.
|
The revert in main (#316165) removed the idle-silence feature. This merge keeps all idle-silence changes from the branch: race candidate, config setting, steering text refactor, and tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
⏳ Queued vscode build for
|
|
🚀 Queued eval-assessment publish build for
|
|
🔬 Queued eval-assessment benchmark for
Results will be posted back here when the run completes. |
|
✅ Eval-assessment build published.
|
|
📊 Eval-assessment benchmark complete.
🧪 Results |
|
📊 Eval-assessment benchmark complete.
🧪 Results |
|
📊 Eval-assessment benchmark complete.
🧪 Results |
Re-land of #315885 on a standalone branch for isolated eval testing.
What this does
If a synchronous
run_in_terminalcall produces no terminal output for N ms (default 60s), a newidleSilencerace candidate wins the foreground race and promotes the execution to background. The process is never killed — the model gets the terminal ID + output so far and canget_terminal_output,send_to_terminal, orkill_terminal.Changes (3 files)
runInTerminalTool.ts: NewidleSilencerace candidate usingRunOnceScheduler+onDatalistener. Refactors_buildInputNeededSteeringTextfrommentionTimeout: booleantohungHint: 'none' | 'timeout' | 'idleSilence'discriminator with per-mode wording.terminalChatAgentToolsConfiguration.ts: New settingchat.tools.terminal.idleSilenceTimeoutMs(default 60000, 0 disables, experimental).runInTerminalTool.test.ts: 3 unit tests for steering text across all hint modes.Why this is safe
npm install,cargo build, etc.) reset the timer and never trip.OutputMonitoridle detection.raceCleanupDisposableStore— disposed when any other race candidate wins.