better persistance on autopilot modes + learn more permissions #304918
Merged
better persistance on autopilot modes + learn more permissions #304918
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves persistence of the chat tool auto-approval “permission level” (including autopilot modes) across chat sessions, and adds “Learn More” entry points in permission pickers. It also refines Action Widget sizing/styling to better support mixed items with/without descriptions.
Changes:
- Persist
permissionLevelin chat input state/session metadata and restore it when reopening sessions. - Add “Learn More about Permissions” actions to permission pickers (workbench + sessions window).
- Adjust Action Widget row sizing logic and CSS for description-below layouts.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/common/model/chatSessionStore.ts | Adds permissionLevel to session index metadata and captures it from the model. |
| src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.ts | Persists permissionLevel in the operation-log schema for input state. |
| src/vs/workbench/contrib/chat/common/model/chatModel.ts | Extends input state serialization/deserialization to include permissionLevel. |
| src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts | Seeds remote session input state with stored permissionLevel (from session metadata). |
| src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts | Attempts to keep model refs alive across session switches to preserve input state. |
| src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.ts | Adds a “Learn More” action (opens docs) to the permission picker UI. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts | Syncs permission level to/from the input model and persists it with the draft state. |
| src/vs/sessions/contrib/chat/browser/newChatViewPane.ts | Resets the sessions-window permission picker after sending a request. |
| src/vs/sessions/contrib/chat/browser/newChatPermissionPicker.ts | Adds “Learn More” item and opener integration; supports items without a level. |
| src/vs/platform/actionWidget/browser/actionWidget.css | Tweaks description-below styling and hover selector formatting. |
| src/vs/platform/actionWidget/browser/actionList.ts | Introduces per-item height calculation to shrink items without descriptions in description-below mode. |
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts:716
oldRefis added to_cachedModelRefs, but immediately after thatthis.modelRef.value = undefined;disposes the previousIChatModelReference(MutableDisposable setter disposes the old value). This defeats the intended caching and can leave disposed refs in_cachedModelRefs. Usethis.modelRef.clearAndLeak()(or otherwise prevent disposal) before moving the reference into_cachedModelRefsso the reference count stays alive across session switches.
// Keep the old model reference alive so its InputModel state (permission level, etc.)
// survives while the user switches between sessions.
const oldRef = this.modelRef.value;
if (oldRef && oldModelResource) {
this._cachedModelRefs.set(oldModelResource.toString(), oldRef);
}
this.modelRef.value = undefined;
src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts
Show resolved
Hide resolved
joshspicer
previously approved these changes
Mar 25, 2026
joshspicer
approved these changes
Mar 25, 2026
This was referenced Mar 26, 2026
mjbvz
pushed a commit
to mjbvz/vscode
that referenced
this pull request
Mar 26, 2026
…soft#304918) * better persistance on autopilot modes * fix persistence of permissions picker
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.
fix #304836
fix #302813
cc @sandeep-sen