Skip to content

ChatModes: throttle update requests, only fire on change#320088

Merged
aeschli merged 5 commits into
mainfrom
aeschli/surrounding-swift-442
Jun 5, 2026
Merged

ChatModes: throttle update requests, only fire on change#320088
aeschli merged 5 commits into
mainfrom
aeschli/surrounding-swift-442

Conversation

@aeschli
Copy link
Copy Markdown
Contributor

@aeschli aeschli commented Jun 5, 2026

No description provided.

Copilot AI review requested due to automatic review settings June 5, 2026 12:17
@aeschli aeschli enabled auto-merge (squash) June 5, 2026 12:17
@aeschli aeschli self-assigned this Jun 5, 2026
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

This PR improves chat mode refresh behavior by throttling refresh requests and ensuring change events only fire when the computed/custom mode data actually changes. It also introduces structural equality helpers for several customization-related payload types and adjusts tests to await deterministic refresh completion.

Changes:

  • Throttle custom-mode refreshes in ChatModes and gate onDidChange firing on detected structural changes.
  • Add isEquals helpers for IAgentSource, ChatRequestHooks, and IParsedHookCommand (with new unit tests).
  • Improve cancellation handling when collecting chat session customizations and make chat mode tests wait for pending updates instead of timeout(0).
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test.ts Adds unit tests covering IAgentSource.isEquals.
src/vs/workbench/contrib/chat/test/common/promptSyntax/hookSchema.test.ts Adds unit tests covering ChatRequestHooks.isEquals.
src/vs/workbench/contrib/chat/test/common/chatModeService.test.ts Makes refresh waiting deterministic via waitForPendingUpdates() and adds a “no-change event” test.
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.ts Introduces IAgentSource.isEquals for source comparisons.
src/vs/workbench/contrib/chat/common/promptSyntax/hookSchema.ts Introduces ChatRequestHooks.isEquals for hook payload comparisons.
src/vs/workbench/contrib/chat/common/customizationHarnessService.ts Avoids returning results when cancellation is requested.
src/vs/workbench/contrib/chat/common/chatModes.ts Implements throttled refresh, cancellation, and change-detection in CustomChatMode.updateData.
src/vs/platform/agentPlugins/test/common/pluginParsers.test.ts Adds unit tests for IParsedHookCommand.isEquals.
src/vs/platform/agentPlugins/common/pluginParsers.ts Introduces IParsedHookCommand.isEquals for structural comparisons (URIs/env).

Copilot's findings

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

Comment thread src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.ts Outdated
Comment thread src/vs/workbench/contrib/chat/common/chatModes.ts Outdated
aeschli and others added 4 commits June 5, 2026 14:56
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@aeschli aeschli merged commit 6774021 into main Jun 5, 2026
25 checks passed
@aeschli aeschli deleted the aeschli/surrounding-swift-442 branch June 5, 2026 13:18
@vs-code-engineering vs-code-engineering Bot added this to the 1.124.0 milestone Jun 5, 2026
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