Skip to content

Background terminal notifications: preserve agent and run on conversation model (1.124)#320642

Open
meganrogge wants to merge 2 commits into
release/1.124from
merogge/terminal-notification-conversation-model-1.124
Open

Background terminal notifications: preserve agent and run on conversation model (1.124)#320642
meganrogge wants to merge 2 commits into
release/1.124from
merogge/terminal-notification-conversation-model-1.124

Conversation

@meganrogge

@meganrogge meganrogge commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Backports #320639 (and the agentIdSilent routing from #320608) to release/1.124. Addresses #320611.

When a run_in_terminal command runs in the background, VS Code sends a steering notification to the chat session when it finishes / needs input / exits. That notification message starts a full agent turn.

To save cost, these turns were forced onto the free copilot/copilot-utility-small (gpt-4o-mini) model. But that model can't drive the agentic tool-calling loop, so the agent went silent after a backgrounded command finished — e.g. when npm i failed, the notification arrived but the agent never reported it or continued.

A notification turn runs over the full conversation context, so it was never going to be free. This removes the utility-model override and runs the notification on the conversation's own model (lastRequest.modelId) instead. The agentIdSilent routing from #320608 is kept so the correct agent still resumes.

Updated the unit test accordingly; focused test passes.

Megan Rogge added 2 commits June 9, 2026 14:09
Background terminal completion / input-needed / exited notifications start a full agent turn. They were forced onto the copilot-utility-small (gpt-4o-mini) model, which cannot reliably assess the command output or drive the agentic tool loop, so the agent went silent after a backgrounded command finished (e.g. it never reported that 'npm i' failed). Run these notifications on the conversation's own model instead, while keeping the agentIdSilent routing from #320608.
Copilot AI review requested due to automatic review settings June 9, 2026 18:10
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@anthonykim1

Matched files:

  • src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts
  • src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 backports a combined fix to release/1.124 to ensure background terminal completion/input-needed notifications start an agent turn that (1) resumes the same agent participant that initiated the terminal command and (2) runs on the conversation’s chosen model, avoiding the “silent agent” failure mode when the utility model can’t reliably process output.

Changes:

  • Preserve agent routing for background terminal steering requests by forwarding agentIdSilent from the conversation’s last request.
  • Run background terminal notification turns on the conversation model (lastRequest.modelId) instead of forcing copilot/copilot-utility-small.
  • Update the unit test to assert both the conversation model and agentIdSilent are preserved.
Show a summary per file
File Description
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts Captures model/mode/tools plus agentIdSilent from the last request; removes utility-model override path and related service dependency.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts Extends steering request capture to include send options and adds a regression test for model + agent preservation.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@meganrogge meganrogge self-assigned this Jun 9, 2026
@meganrogge meganrogge added this to the 1.124.0 milestone Jun 9, 2026
@meganrogge meganrogge enabled auto-merge (squash) June 9, 2026 18:21
@meganrogge meganrogge closed this Jun 9, 2026
auto-merge was automatically disabled June 9, 2026 18:23

Pull request was closed

@meganrogge meganrogge reopened this Jun 9, 2026
@meganrogge meganrogge enabled auto-merge (squash) June 9, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants