Skip to content

Support for creating new chat with metadata#268236

Draft
osortega wants to merge 1 commit intomainfrom
osortega/adding-new-chat-with-metadata
Draft

Support for creating new chat with metadata#268236
osortega wants to merge 1 commit intomainfrom
osortega/adding-new-chat-with-metadata

Conversation

@osortega
Copy link
Copy Markdown
Contributor

Related to: #268219

This adds a new command to support creating new chats with metadata

Copilot AI review requested due to automatic review settings September 24, 2025 20:57
@osortega osortega self-assigned this Sep 24, 2025
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 adds support for creating new chat sessions with metadata by introducing a new command and updating the chat session infrastructure to handle metadata throughout the chat lifecycle.

  • Adds a new action OpenNewChatSessionEditorWithMetadata to create chat editors with custom metadata
  • Updates chat session types and interfaces to properly type metadata as Record<string, any>
  • Enhances the chat session service to extract and pass metadata from existing editors when resolving sessions

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.ts Adds new OpenNewChatSessionEditorWithMetadata action class
src/vs/workbench/contrib/chat/browser/chat.contribution.ts Registers the new metadata action and updates imports
src/vs/workbench/contrib/chat/browser/chatEditor.ts Extends IChatEditorOptions interface to include optional metadata field
src/vs/workbench/contrib/chat/browser/chatSessions.contribution.ts Updates metadata type definition and adds metadata extraction logic

for (const editor of group.editors) {
if (editor instanceof ChatEditorInput) {
try {
if (editor.sessionId === request.sessionId) {
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metadata assignment should be placed after the null check for editor.options. If editor.options is undefined, accessing editor.options.metadata will throw a runtime error.

Suggested change
if (editor.sessionId === request.sessionId) {
if (editor.sessionId === request.sessionId && editor.options) {

Copilot uses AI. Check for mistakes.
});
}

async run(accessor: ServicesAccessor, chatSessionType: string, metadata: Record<string, any>) {
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chatSessionType and metadata parameters lack input validation. Consider adding validation to ensure chatSessionType is not empty and metadata is a valid object to prevent runtime errors.

Copilot uses AI. Check for mistakes.
@vs-code-engineering vs-code-engineering bot added this to the September 2025 milestone Sep 24, 2025
request,
prompt: request.message,
history,
metadata
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am deleting this dynamic agent with #268089

@osortega osortega marked this pull request as draft September 24, 2025 21:08
@rebornix rebornix modified the milestones: September 2025, October 2025 Oct 3, 2025
@mjbvz mjbvz modified the milestones: October 2025, November 2025 Nov 12, 2025
@bpasero bpasero modified the milestones: December 2025, January 2026 Jan 20, 2026
@mjbvz mjbvz modified the milestones: January 2026, 1.112.0, 1.113.0 Mar 11, 2026
@mjbvz
Copy link
Copy Markdown
Collaborator

mjbvz commented Mar 17, 2026

@osortega Moving to 1.113 since does not look like a candidate. Please make sure to stay on top of your issue's and PR's target milestone in the future as we need to end endgame on Monday at zero

@jrieken jrieken modified the milestones: 1.113.0, On Deck Mar 25, 2026
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.

9 participants