make sure agents new sessions page respects selected picker#315586
Draft
justschen wants to merge 8 commits into
Draft
make sure agents new sessions page respects selected picker#315586justschen wants to merge 8 commits into
justschen wants to merge 8 commits into
Conversation
Contributor
|
Base:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a regression in the Agents/Sessions “new session” flow where the permission mode picker could reset/lose the user’s chosen permission level while the session is starting.
Changes:
- Avoid resetting permission level on empty chat input state unless the model has no permission level set.
- Make the sessions permission picker’s trigger label follow the active session’s permission level via an observable.
- Seed newly created Copilot (CLI/Local) sessions with the configured default permission level, clamped when enterprise policy disables auto-approval.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts | Changes empty-state initialization so permission level isn’t overwritten when a non-default value is already present. |
| src/vs/sessions/contrib/copilotChatSessions/browser/permissionPicker.ts | Adds a derived observable on the Copilot delegate so the picker label stays in sync with the active session’s permission level. |
| src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsProvider.ts | Seeds new sessions’ permission level from chat.permissions.default with enterprise-policy clamping and reuses that logic across creation paths. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 2
roblourens
previously approved these changes
May 11, 2026
roblourens
previously approved these changes
May 11, 2026
Collaborator
Author
Co-authored-by: justschen <54879025+justschen@users.noreply.github.com>
Contributor
The temp CLI session created by |
Co-authored-by: justschen <54879025+justschen@users.noreply.github.com>
Copilot
AI
changed the title
make sure agents new sessions page respects selected picker
Fix TypeScript compile errors in copilotChatSessionsProvider tests
May 11, 2026
auto-merge was automatically disabled
May 11, 2026 04:23
Pull request was converted to draft
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.
Fixes TypeScript errors in
copilotChatSessionsProvider.test.tsthat caused the "Compile & Hygiene" CI job to fail.Description
The test code incorrectly used
disposables.add()onICopilotChatSessionobjects returned byprovider.getSession(). SinceICopilotChatSessiondoes not extendIDisposable(it lacks adisposemethod), this caused two TypeScript errors per test:TS2741: Property 'dispose' is missing in type 'ICopilotChatSession' but required in type 'IDisposable'TS2339: Property 'permissionLevel' does not exist on type 'IDisposable'(becausedisposables.add()returnsIDisposable, losing theICopilotChatSessiontype)The fix reverts those calls back to the original pattern of directly using
provider.getSession(sessionInfo.sessionId)with optional chaining (session?.permissionLevel.get()). Sessions are owned and managed by the provider, which is itself tracked by the test'sDisposableStore, so no separate disposal of the session is needed.Testing