Skip to content

better persistance on autopilot modes + learn more permissions #304918

Merged
justschen merged 10 commits intomainfrom
justin/durant
Mar 26, 2026
Merged

better persistance on autopilot modes + learn more permissions #304918
justschen merged 10 commits intomainfrom
justin/durant

Conversation

@justschen
Copy link
Copy Markdown
Collaborator

@justschen justschen commented Mar 25, 2026

Copilot AI review requested due to automatic review settings March 25, 2026 21:53
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 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 permissionLevel in 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

  • oldRef is added to _cachedModelRefs, but immediately after that this.modelRef.value = undefined; disposes the previous IChatModelReference (MutableDisposable setter disposes the old value). This defeats the intended caching and can leave disposed refs in _cachedModelRefs. Use this.modelRef.clearAndLeak() (or otherwise prevent disposal) before moving the reference into _cachedModelRefs so 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;

joshspicer
joshspicer previously approved these changes Mar 25, 2026
@justschen justschen closed this Mar 25, 2026
@justschen justschen reopened this Mar 25, 2026
@justschen justschen closed this Mar 25, 2026
@justschen justschen reopened this Mar 25, 2026
@justschen justschen closed this Mar 26, 2026
@justschen justschen reopened this Mar 26, 2026
@justschen justschen enabled auto-merge (squash) March 26, 2026 05:29
@justschen justschen merged commit ae7b665 into main Mar 26, 2026
18 checks passed
@justschen justschen deleted the justin/durant branch March 26, 2026 07:29
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
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.

Sessions: Autopilot persists inconsistently Add link to relevant settings on Default Approvals

3 participants