microsoft / microsoft/vscode

Investigate new chat mode picker refresh after workspace changes

Open
#329,111 0 comments 0 reactions 1 assignee Claimed by @benvillalobos View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

### Summary

While migrating the automation dialog to `NewChatInputWidget`, the mode picker renders its initial options correctly but does not reliably refresh after the workspace picker replaces the dialog's independent draft session.

### Expected

When the selected workspace changes, the mode picker should derive its available modes and selected value from the replacement draft session supplied to `NewChatInputWidget`.

### Observed

The initial modes load, but changing the workspace can leave the picker showing modes from the previous/global draft.

### Investigation Notes

There are two relevant mode-picker paths:

- The shared Local/Copilot `ModePickerModel` is updated from `ISessionsService.activeSession`, while the rendered picker receives and writes to the widget-scoped `ISessionContext`. The automation dialog intentionally uses a separate `automationSession`, so replacing it does not update the global model.
- `AgentHostModePicker` reads the scoped `IActiveSession` directly and subscribes to provider session-config changes. Its reload path appears correctly wired statically, so reproducing the failure should verify draft replacement, resolved session IDs, and `onDidChangeSessionConfig` delivery.

Also verify whether the toolbar's provider/type `when` context keys follow the scoped draft when switching providers, rather than inherited global session keys.

### Working Branch

https://github.com/microsoft/vscode/tree/bv/automations-new-chat-input

The branch contains the incremental automation-dialog migration and provides a quick way to reproduce and instrument the behavior.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.