feat: enhance session customization handling with throttling and cancellation support#320038
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refines agent-host session customization discovery and bundling behavior by reducing redundant filesystem writes and making refresh handling more robust under rapid change (via throttling + cancellation-aware refresh).
Changes:
- Optimize
SessionPluginBundler.bundle()to skip deleting/re-writing the on-disk plugin bundle when the computed content nonce is unchanged. - Introduce throttled, cancellation-aware refresh logic in
SessionDiscoveredEntryto avoid unstable intermediate states during repeated discovery updates. - Add/adjust unit tests to validate “no rewrite on identical content” and “clears discovered customizations when roots disappear”.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/agentHost/node/shared/sessionPluginBundler.ts | Avoids re-writing bundle output when the content-based nonce is unchanged. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Adds throttling + cancellation handling to session-discovered customization refreshes. |
| src/vs/platform/agentHost/test/node/sessionCustomizationDiscovery.test.ts | Extends nonce stability test to assert no filesystem writes/deletes on identical rebundles. |
| src/vs/platform/agentHost/test/node/copilotAgent.test.ts | Adds test ensuring discovered directory customizations clear when the underlying directory is deleted. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 5
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>
…d timeout handling
roblourens
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.