Skip to content

Add ChatSessionInputState#302609

Draft
mjbvz wants to merge 1 commit intomicrosoft:mainfrom
mjbvz:dev/mjbvz/amused-xerinae
Draft

Add ChatSessionInputState#302609
mjbvz wants to merge 1 commit intomicrosoft:mainfrom
mjbvz:dev/mjbvz/amused-xerinae

Conversation

@mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented Mar 17, 2026

Adds the concept of a managed ChatSessionInputState object. This object is how extension can interact with the chat session input box

@TylerLeonhardt @DonJayamanne Can you please review the api and let me know what you think. This PR is just the api changes for now. Here's a few example flows:

New blank chat editor

  1. VS Code invoke provideChatSessionInputState on your controller.
  2. The returned options are shown to the user

Use presses submit on blank chat editor

  1. The previously returned input state is passed to newChatSessionItemHandler to create the chat session item
  2. It is then also passed to provideChatSessionContent

Use reloads with a chat editor visible

  1. We call provideChatSessionInputState again so that extensions can still provide custom options. However we also pass in the previously selected options so that you can use these if you need

Adds the concept of a managed `ChatSessionInputState` object. This object is how extension can interact with the chat session input box
Copilot AI review requested due to automatic review settings March 17, 2026 23:54
Copy link
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.

Copilot wasn't able to review any files in this pull request.


You can also share your feedback on Copilot code review. Take the survey.

@DonJayamanne
Copy link
Contributor

provideChatSessionInputState?: ChatSessionControllerProvideInputState;

What is the value for sessionResource: Uri?
Where does VS Code get this from?
Please can you provide an example of what this would contain

I am assuming I can ignore this entirely
If not required by Claude/CLI, i would suggest adding never of undefined for now.
This helps avoid confusions on what this is,

Use reloads with a chat editor visible

I'm assuming VS Code then keeps track of what was previously selected (e.g. when re-loading vscode with 2 chat editors open)

User selects items from the options

I'm assuming when user selects something from the option (dropdwon), VS Code will just call provideChatSessionInputState once again, is that right?

Over all this looks great and very simple
Thanks @mjbvz

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.

3 participants