Skip to content

Preserve instructions for terminal completion notifications - #330570

Merged
Megan Rogge (meganrogge) merged 4 commits into
microsoft:mainfrom
abmahdy:fix/terminal-notification-instruction-context
Aug 13, 2026
Merged

Megan Rogge (meganrogge) merged 4 commits into
microsoft:mainfrom
abmahdy:fix/terminal-notification-instruction-context

Conversation

@abmahdy

Copy link
Copy Markdown
Contributor

Fixes #330561

Background terminal completion, input-needed, and terminal-exited notifications resume the previous model, mode, tools, and agent. However, they did not pass an instructionContext, so IChatService skipped automatic instruction collection for the system-initiated turn.

This change:

  • forwards an instructionContext based on the previous request's mode and selected tools
  • uses the existing shared notification options, covering all three background notification paths
  • extends the existing completion-notification test to assert that mode and tools are preserved for instruction collection

Validation:

  • npm run typecheck-client
  • node node_modules/gulp/bin/gulp.js compile-client
  • pre-commit hygiene for both changed files

The focused Electron test was added but could not be launched locally because this machine does not have the Windows 10 SDK required by the VS Code Electron test harness. CI remains the runtime test gate.

Copilot AI balanced review requested due to automatic review settings August 12, 2026 23:37
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

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

Anthony Kim (@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

Preserves instruction collection context for background terminal notifications.

Changes:

  • Forwards previous mode and selected tools through instructionContext.
  • Extends completion-notification coverage for preserved context.

Reviewed changes

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

File Description
runInTerminalTool.ts Adds instruction context to notification requests.
runInTerminalTool.test.ts Verifies mode and tools are forwarded.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@abmahdy

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree [company="Microsoft"]

@abmahdy

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@abmahdy
Ahmed Mahdy (abmahdy) force-pushed the fix/terminal-notification-instruction-context branch from 70e2107 to 187d789 Compare August 12, 2026 23:55

@meganrogge Megan Rogge (meganrogge) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you!

@meganrogge
Megan Rogge (meganrogge) enabled auto-merge (squash) August 13, 2026 16:15
@meganrogge
Megan Rogge (meganrogge) merged commit 0ace0fa into microsoft:main Aug 13, 2026
27 checks passed
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Sep 27, 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.

Terminal background-completion turns are sent without instructionContext, so instructions/skills are dropped (regression in 1.131.0)

5 participants