Skip to content

Align async terminal notification messaging with runtime gating for subagent invocations#308857

Closed
Copilot wants to merge 5 commits intomainfrom
copilot/fix-comments-in-review-thread
Closed

Align async terminal notification messaging with runtime gating for subagent invocations#308857
Copilot wants to merge 5 commits intomainfrom
copilot/fix-comments-in-review-thread

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

Description

This addresses review feedback on PR #308840 around run_in_terminal notification semantics.

  • Static model description wording

    • Simplified the static shell/tool guidance by removing the conditional caveat language.
    • The description now uses the standard notification wording when chat.tools.terminal.backgroundNotifications is enabled.
  • Runtime behavior remains the source of truth

    • RunInTerminalTool.invoke continues to use:
      • chat.tools.terminal.backgroundNotifications
      • and !invocation.subAgentInvocationId
    • via shouldSendBackgroundNotifications to control both:
      • completion notification registration
      • timeout result hint (“You will be automatically notified…”)
    • The configuration check is now strict boolean (=== true) for consistency with model-description gating and to avoid truthy non-boolean config values enabling notifications.
  • Regression coverage

    • Kept focused unit coverage for subagent invocation timeout behavior to verify:
      • no auto-notification hint in result text
      • no completion-notification registration path
const shouldSendBackgroundNotifications =
	this._configurationService.getValue(TerminalChatAgentToolsSettingId.BackgroundNotifications) === true
	&& !invocation.subAgentInvocationId;

Testing

  • npm run compile-check-ts-native
  • npm run gulp compile
  • ELECTRON_DISABLE_SANDBOX=1 DISPLAY=:99 xvfb-run ./scripts/test.sh --run src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts

Copilot AI requested review from Copilot and removed request for Copilot April 9, 2026 18:56
Copilot AI requested review from Copilot and removed request for Copilot April 9, 2026 19:06
Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/12b1d655-32d6-41ac-a3c8-429db819f310

Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot April 9, 2026 19:08
Copilot AI changed the title [WIP] Fix code based on review comments Clarify async terminal notification guarantees and suppress subagent notification hints Apr 9, 2026
Copilot AI requested a review from meganrogge April 9, 2026 19:09
@meganrogge
Copy link
Copy Markdown
Collaborator

@copilot instead of this conditional language, shouldn't we just check shouldSendBackgroundNotifications to determine whether to include that or not

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/d6eca4d7-7628-48cc-952a-162419f60927

Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot April 9, 2026 19:21
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 9, 2026

@copilot instead of this conditional language, shouldn't we just check shouldSendBackgroundNotifications to determine whether to include that or not

Updated in 7fb6dab: I removed the conditional caveat wording from the static model-description text and kept runtime inclusion of the completion hint gated by shouldSendBackgroundNotifications.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --crashpad-handler-pid=6766 --enable-crash-reporter=fad24fb9-3982-47aa-928a-7ff5ec9a125e,no_channel --user-data-dir=/tmp/vscode-tests-1775762275569 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,6184154506328862400,6547258475820409534,262144 --enable-features=PdfUseShowSaveFilePicker --disable-features=LocalNetworkAccessChecks,ScreenAIOCREnabled,SpareRendererForSitePerProcess,TraceSiteInstanceGetProcessCreation --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: .build/electron/code-oss .build/electron/code-oss test/unit/electron/index.js --crash-reporter-directory=/home/REDACTED/work/vscode/vscode/.build/crashes --run src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --crashpad-handler-pid=8436 --enable-crash-reporter=fad24fb9-3982-47aa-928a-7ff5ec9a125e,no_channel --user-data-dir=/tmp/vscode-tests-1775762453524 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1091046911582232330,11144155131318774953,262144 --enable-features=PdfUseShowSaveFilePicker --disable-features=LocalNetworkAccessChecks,ScreenAIOCREnabled,SpareRendererForSitePerProcess,TraceSiteInstanceGetProcessCreation --variations-seed-version --trace-process-track-uuid=3190708989122997041 odules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/sh rces false --sourceMap node (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Clarify async terminal notification guarantees and suppress subagent notification hints Align async terminal notification messaging with runtime gating for subagent invocations Apr 9, 2026
@meganrogge meganrogge marked this pull request as ready for review April 9, 2026 19:23
Copilot AI review requested due to automatic review settings April 9, 2026 19:23
@meganrogge meganrogge enabled auto-merge (squash) April 9, 2026 19:23
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

Aligns run_in_terminal’s runtime background-notification behavior with the messaging shown to the model/agent, especially for subagent tool invocations where background notifications can’t be delivered.

Changes:

  • Introduces a shared shouldSendBackgroundNotifications gate in RunInTerminalTool.invoke to control both completion-notification registration and the timeout “you will be notified” hint.
  • Adds a unit test intended to ensure subagent invocations do not receive background-notification messaging or registration.
Show a summary per file
File Description
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts Centralizes the background-notifications gate and reuses it for both registration and timeout hint text.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts Adds regression coverage for subagent invocation behavior around background-notification messaging/registration.

Copilot's findings

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

…r/tools/runInTerminalTool.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@meganrogge
Copy link
Copy Markdown
Collaborator

@copilot fix this error Error: [core-ci ] src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts(921,9): error TS2451: Cannot redeclare block-scoped variable 'shouldSendBackgroundNotifications'.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 9, 2026

@copilot fix this error Error: [core-ci ] src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts(921,9): error TS2451: Cannot redeclare block-scope...

Checked and validated on current head e19ab1c: runInTerminalTool.ts has a single shouldSendBackgroundNotifications declaration, and local validation passes (npm run compile-check-ts-native, npm run gulp compile, and the targeted runInTerminalTool test). This TS2451 error should be resolved on the latest commit.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --crashpad-handler-pid=8436 --enable-crash-reporter=33056d0d-6568-4e7f-a03d-263d461716c7,no_channel --user-data-dir=/tmp/vscode-tests-1775767732201 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,12575379078208737013,7802589559715553564,262144 --enable-features=PdfUseShowSaveFilePicker --disable-features=LocalNetworkAccessChecks,ScreenAIOCREnabled,SpareRendererForSitePerProcess,TraceSiteInstanceGetProcessCreation --variations-seed-version --trace-process-track-uuid=3190708989122997041 preview-linux-x64/lib/tsgo --inlineSourcesnode false --sourceMap preview-linux-x6/home/REDACTED/work/vscode/vscode/extensions/vscode-colorize-tests/tsconfig.json (dns block)
    • Triggering command: .build/electron/code-oss .build/electron/code-oss test/unit/electron/index.js --crash-reporter-directory=/home/REDACTED/work/vscode/vscode/.build/crashes --run src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts tsconfig.json --pretty false --sourceMap --inlineSources --project in/sh (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from meganrogge April 9, 2026 20:50
@meganrogge
Copy link
Copy Markdown
Collaborator

meganrogge commented Apr 9, 2026

@copilot delete the test changes and add instruction when a subagent is used to use high timeout value since there will be no background notification to indicate completion

@meganrogge meganrogge closed this Apr 10, 2026
auto-merge was automatically disabled April 10, 2026 16:00

Pull request was closed

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.

3 participants