Skip to content

agentHost: refresh Copilot instructions for new sessions - #350863

Draft
Martin Aeschlimann (aeschli) wants to merge 1 commit into
mainfrom
aeschli/agents/vscode-issue-345480-investigation
Draft

Martin Aeschlimann (aeschli) wants to merge 1 commit into
mainfrom
aeschli/agents/vscode-issue-345480-investigation

Conversation

@aeschli

@aeschli Martin Aeschlimann (aeschli) commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #345480

Summary

New Copilot sessions now set instructions.refreshCustomInstructions to invalidate the SDK's process-wide instruction discovery cache before loading custom instructions. Changes to instruction files therefore reach new conversations without requiring a window reload. Resumed sessions are unchanged; the launcher test covers regular creates, ephemeral creates, and resumes.

Testing

  • pnpm run compile-client — passed.
  • .\scripts\test.bat --run src\vs\platform\agentHost\test\node\copilotSessionLauncher.test.ts — passed (264 tests).
  • pnpm run oxlint src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts — passed.
  • git diff --check — passed.

Fixes #345480

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 28, 2026 16:45

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.

🔵 Needs a closer look

Process-wide SDK cache invalidation may affect existing conversations, while launcher mocks verify only RPC options, leaving disk freshness and cross-session effects dependent on human runtime validation.

No open issues 🎉

What changed in this PR

Addresses #345480 by refreshing the Copilot SDK’s instruction discovery cache when creating sessions, so new conversations can use instruction-file changes without a window reload.

Changes:

  • Enables refreshCustomInstructions for regular and ephemeral session creation while leaving resume options unchanged.
  • Extends launcher tests to verify the option is present for creates and absent for resumes.
File Description
src/​vs/​platform/​agentHost/​test/​node/​copilotSessionLauncher.test.ts Adds refresh-option assertions for regular creates, ephemeral creates, and resumes.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotSessionLauncher.ts Enables instruction-cache refresh in SDK create options, preserving existing instruction configuration.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

Copilot harness: new chats keep using the instruction files from when the window opened until you reload

2 participants